Skip to content

Commit

Permalink
Fixed tests failing after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
M1ha-Shvn committed Oct 29, 2021
1 parent d899cb8 commit 1c6481f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions tests/test_bulk_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bulk_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c6481f

Please sign in to comment.