From b52d96a55e017bfce18e63a0c0d21c93a8416587 Mon Sep 17 00:00:00 2001 From: reverend Date: Sun, 13 Sep 2020 19:17:04 +0200 Subject: [PATCH] More and better test failure messages --- .../tests/models/test_abstract_models.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py index 4b174c1..311b989 100644 --- a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py +++ b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py @@ -72,9 +72,21 @@ class SubmittableTestCase(ModelTestCase): ) self.assertTrue( submitted_by.null, - msg='Expecting the sub' + msg='Expecting %s to has null=True' % ( + str(submitted_by) ) - self.assertTrue(submitted_by.blank) + ) + self.assertTrue( + submitted_by.blank, + msg='Expecting %s to has blank=True' % ( + str(submitted_by) + ) + ) self.assertEqual( - submitted_by.remote_field.on_delete, models.SET_NULL) + submitted_by.remote_field.on_delete, + models.SET_NULL + msg='Expecting %s to be null when reference is delete (models.SET_NULL)' % ( + str(submitted_by) + ) + )