From 1c6481f3f7fb052402f4a55db6499cfa90009e26 Mon Sep 17 00:00:00 2001 From: "M1ha.Shvn" Date: Fri, 29 Oct 2021 21:51:33 +0500 Subject: [PATCH] Fixed tests failing after merge --- tests/test_bulk_create.py | 5 +---- tests/test_bulk_update.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/test_bulk_create.py b/tests/test_bulk_create.py index 2a903cb..f32efe3 100644 --- a/tests/test_bulk_create.py +++ b/tests/test_bulk_create.py @@ -313,9 +313,6 @@ def test_auto_now(self): self.assertGreaterEqual(instance.created, now() - timedelta(seconds=1)) self.assertLessEqual(instance.created, now() + timedelta(seconds=1)) self.assertIsNone(instance.checked) - - # pg_bulk_create does not use native bulk_create method and sets correct date - # So get_auto_now_date() is not needed here self.assertEqual(instance.updated, now().date()) def test_auto_now_given_directly(self): @@ -329,7 +326,7 @@ def test_auto_now_given_directly(self): self.assertGreaterEqual(instance.created, now() - timedelta(seconds=1)) self.assertLessEqual(instance.created, now() + timedelta(seconds=1)) self.assertIsNone(instance.checked) - self.assertEqual(instance.updated, get_auto_now_date()) + self.assertEqual(instance.updated, now().date()) def test_quoted_table_name(self): # Test for https://github.com/M1ha-Shvn/django-pg-bulk-update/issues/63 diff --git a/tests/test_bulk_update.py b/tests/test_bulk_update.py index b8db3cc..29ded31 100644 --- a/tests/test_bulk_update.py +++ b/tests/test_bulk_update.py @@ -411,7 +411,7 @@ def test_auto_now_given_directly(self): instance = AutoNowModel.objects.get() self.assertEqual(datetime(2019, 1, 1, tzinfo=tz_utc), instance.created) self.assertEqual(datetime(2020, 1, 2, 0, 0, 0, tzinfo=tz_utc), instance.checked) - self.assertEqual(instance.updated, get_auto_now_date()) + self.assertEqual(instance.updated, now().date()) def test_auto_now_respects_override(self): # Now check to make sure we can explicitly set values