mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-05-19 21:01:52 +00:00
Stop handling an impossible case
We check eliminate the case with zero log entries when checking that obj.history.count() is exactly 1.
This commit is contained in:
parent
2b44eebd50
commit
f647966210
1 changed files with 6 additions and 11 deletions
|
|
@ -44,17 +44,12 @@ class SimpleModelTest(TestCase):
|
|||
# Check for log entries
|
||||
self.assertEqual(obj.history.count(), 1, msg="There is one log entry")
|
||||
|
||||
try:
|
||||
history = obj.history.get()
|
||||
except obj.history.DoesNotExist:
|
||||
self.assertTrue(False, "Log entry exists")
|
||||
else:
|
||||
self.assertEqual(
|
||||
history.action, LogEntry.Action.CREATE, msg="Action is 'CREATE'"
|
||||
)
|
||||
self.assertEqual(
|
||||
history.object_repr, str(obj), msg="Representation is equal"
|
||||
)
|
||||
history = obj.history.get()
|
||||
|
||||
self.assertEqual(
|
||||
history.action, LogEntry.Action.CREATE, msg="Action is 'CREATE'"
|
||||
)
|
||||
self.assertEqual(history.object_repr, str(obj), msg="Representation is equal")
|
||||
|
||||
def test_update(self):
|
||||
"""Updates are logged correctly."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue