Unverified Commit 354846a4 authored by David Haynes's avatar David Haynes
Browse files

Test against the error code returned by the error instead

- 1406: data too long
parent fa11c3c4
Pipeline #1081 failed with stage
in 1 minute and 3 seconds
...@@ -62,7 +62,10 @@ class RegisteredUserTest(TestCase): ...@@ -62,7 +62,10 @@ class RegisteredUserTest(TestCase):
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
""" """
# self.assertRaises(DataError, get_registered_user.save()) try:
get_registered_user.save()
except DataError as ex:
self.assertEqual(str(ex[0]), "1406")
# blank=False is purely form validation related # blank=False is purely form validation related
...@@ -99,7 +102,7 @@ class RegisteredUserTest(TestCase): ...@@ -99,7 +102,7 @@ class RegisteredUserTest(TestCase):
try: try:
get_registered_user.save() get_registered_user.save()
except DataError as ex: except DataError as ex:
print(ex) self.assertEqual(str(ex[0]), "1406")
# blank=False is purely form validation related # blank=False is purely form validation related
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment