mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
add a test case to make when changes has value it wont be overwritten by changes_text
This commit is contained in:
parent
bec21f98ec
commit
904edb0b7b
1 changed files with 15 additions and 0 deletions
|
|
@ -135,6 +135,21 @@ class AuditlogMigrateJsonTest(TestCase):
|
|||
self.assertEqual(errbuf, "")
|
||||
self.assertIsNotNone(log_entry.changes)
|
||||
|
||||
def test_native_postgres_changes_not_overwritten(self):
|
||||
# Arrange
|
||||
log_entry = self.make_logentry()
|
||||
log_entry.changes = original_changes = {"key": "value"}
|
||||
log_entry.changes_text = '{"key": "new value"}'
|
||||
log_entry.save()
|
||||
|
||||
# Act
|
||||
outbuf, errbuf = self.call_command("-d=postgres")
|
||||
log_entry.refresh_from_db()
|
||||
|
||||
# Assert
|
||||
self.assertEqual(errbuf, "")
|
||||
self.assertEqual(log_entry.changes, original_changes)
|
||||
|
||||
def test_native_unsupported(self):
|
||||
# Arrange
|
||||
log_entry = self.make_logentry()
|
||||
|
|
|
|||
Loading…
Reference in a new issue