You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while the name of the tests is test_cannot_save_empty_list_item
Because in the end... the item is saved. It can be verified by putting the following right after the with block:
self.assertEqual(Item.objects.count(), 0)
Two potential solutions
Maybe just swapping the order of the 2 lines might make things less confusing :)
item.full_clean()
item.save()
Another solution would be to simply rename the tests from test_cannot_save_empty_list_item to test_cannot_validate_empty_list_item
And removing the call to save() alltogether.
The text was updated successfully, but these errors were encountered:
It's a bit confusing when you write:
while the name of the tests is
test_cannot_save_empty_list_item
Because in the end... the item is saved. It can be verified by putting the following right after the with block:
Two potential solutions
Maybe just swapping the order of the 2 lines might make things less confusing :)
Another solution would be to simply rename the tests from
test_cannot_save_empty_list_item
totest_cannot_validate_empty_list_item
And removing the call to
save()
alltogether.The text was updated successfully, but these errors were encountered: