

def test_create(self):
    'Creation is logged correctly.'
    obj = self.obj
    self.assertTrue((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')

dataset/ETHPy150Open jjkester/django-auditlog/src/auditlog_tests/tests.py SimpleModelTest.test_create/original