Skip to content

Commit 7bfb406

Browse files
committed
Test for multiple objects for class-based as_of
1 parent 887d44d commit 7bfb406

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

simple_history/tests/tests/test_manager.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ def test_create_and_delete(self):
7979
doc_change.save()
8080
docs_as_of_tmw = models.Document.history.as_of(now + timedelta(days=1))
8181
self.assertFalse(list(docs_as_of_tmw))
82+
83+
def test_multiple(self):
84+
document1 = models.Document.objects.create()
85+
document2 = models.Document.objects.create()
86+
historical = models.Document.history.as_of(datetime.now() + timedelta(days=1))
87+
self.assertEqual(list(historical), [document1, document2])

0 commit comments

Comments
 (0)