From 860b33c4108442019a5490487afb53501c6f9257 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 21 May 2024 21:43:58 +0200 Subject: [PATCH] fix time in snapshots --- reversion_compare/tests/test_variant_model.py | 4 ++++ .../test_variant_model_all_changes_django32_1.snapshot.html | 2 +- .../test_variant_model_all_changes_django42_1.snapshot.html | 2 +- .../test_variant_model_all_changes_django50_1.snapshot.html | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/reversion_compare/tests/test_variant_model.py b/reversion_compare/tests/test_variant_model.py index a864b4a..0a2a130 100644 --- a/reversion_compare/tests/test_variant_model.py +++ b/reversion_compare/tests/test_variant_model.py @@ -14,6 +14,7 @@ :license: GNU GPL v3 or above, see LICENSE for more details. """ from bx_django_utils.test_utils.html_assertion import assert_html_response_snapshot, get_django_name_suffix +from freezegun import freeze_time from override_storage import locmem_stats_override_storage from override_storage.utils import Stats from reversion import create_revision, is_registered @@ -95,7 +96,10 @@ def test_initial_state(self): self.assertEqual(Revision.objects.all().count(), count) self.assertEqual(len(self.version_ids), count) + @freeze_time('2024-02-01') def test_all_changes(self): + self.client.force_login(self.user) + # debug_response(self.client.get("/admin/reversion_compare_project/variantmodel/1/history/")) # compare initial with last version response = self.client.get( diff --git a/reversion_compare/tests/test_variant_model_all_changes_django32_1.snapshot.html b/reversion_compare/tests/test_variant_model_all_changes_django32_1.snapshot.html index 5e323db..d144337 100644 --- a/reversion_compare/tests/test_variant_model_all_changes_django32_1.snapshot.html +++ b/reversion_compare/tests/test_variant_model_all_changes_django32_1.snapshot.html @@ -124,7 +124,7 @@

-- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 6 months)
+- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 5 months)
 + Jan. 1, 2000, midnight (time since that date: 24 years, 1 month)
 
diff --git a/reversion_compare/tests/test_variant_model_all_changes_django42_1.snapshot.html b/reversion_compare/tests/test_variant_model_all_changes_django42_1.snapshot.html index 5e323db..d144337 100644 --- a/reversion_compare/tests/test_variant_model_all_changes_django42_1.snapshot.html +++ b/reversion_compare/tests/test_variant_model_all_changes_django42_1.snapshot.html @@ -124,7 +124,7 @@

-- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 6 months)
+- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 5 months)
 + Jan. 1, 2000, midnight (time since that date: 24 years, 1 month)
 
diff --git a/reversion_compare/tests/test_variant_model_all_changes_django50_1.snapshot.html b/reversion_compare/tests/test_variant_model_all_changes_django50_1.snapshot.html index 5e323db..d144337 100644 --- a/reversion_compare/tests/test_variant_model_all_changes_django50_1.snapshot.html +++ b/reversion_compare/tests/test_variant_model_all_changes_django50_1.snapshot.html @@ -124,7 +124,7 @@

-- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 6 months)
+- Aug. 19, 2005, 8:13 a.m. (time since that date: 18 years, 5 months)
 + Jan. 1, 2000, midnight (time since that date: 24 years, 1 month)