mirror of https://github.com/snachodog/mybuddy.git
Add specific failing string detail to datetime format test (#148)
This commit is contained in:
parent
d138558158
commit
23ac4ade91
|
@ -17,8 +17,11 @@ class FormatsTestCase(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
for example in supported_custom_examples:
|
for example in supported_custom_examples:
|
||||||
|
try:
|
||||||
result = field.to_python(example)
|
result = field.to_python(example)
|
||||||
self.assertIsInstance(result, datetime.datetime)
|
self.assertIsInstance(result, datetime.datetime)
|
||||||
|
except ValidationError:
|
||||||
|
self.fail('Format of "{}" not recognized!'.format(example))
|
||||||
|
|
||||||
with self.assertRaises(ValidationError):
|
with self.assertRaises(ValidationError):
|
||||||
field.to_python('invalid date string!')
|
field.to_python('invalid date string!')
|
||||||
|
|
Loading…
Reference in New Issue