summaryrefslogtreecommitdiff
path: root/talerbank/app/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'talerbank/app/tests.py')
-rw-r--r--talerbank/app/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index b58e3c8..4181c8c 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -51,6 +51,18 @@ def clear_db():
cursor.execute("ALTER SEQUENCE app_banktransaction_id_seq RESTART")
+# Bank used to crash when malformed JSON was sent
+# to some endpoint that needs to authenticate the
+# user.
+class MalformedLoginTestCase(TestCase):
+
+ def test_malformed_login(self):
+ self.client.generic(
+ "POST",
+ reverse("add-incoming", urlconf=urls),
+ "malformed"
+ )
+
class PublicAccountsTestCase(TestCase):
def setUp(self):
clear_db()
@@ -498,6 +510,7 @@ class AddIncomingTestCase(TestCase):
self.assertRaises(CurrencyMismatch)
self.assertEqual(406, response.status_code)
LOGGER.info(response.content.decode("utf-8"))
+
# Try to go debit
data = '{"auth": {"type": "basic"}, \
"credit_account": 1, \