@@ -17,6 +17,13 @@ def setUp(self):
17
17
Poll (id = 4 , question = "Question 4" , pub_date = now ()),
18
18
Poll (id = 5 , question = "Question 5" , pub_date = now ()),
19
19
]
20
+ self .data_with_excluded_fields = [
21
+ PollWithExcludeFields (id = 1 , question = "Question 1" , pub_date = now ()),
22
+ PollWithExcludeFields (id = 2 , question = "Question 2" , pub_date = now ()),
23
+ PollWithExcludeFields (id = 3 , question = "Question 3" , pub_date = now ()),
24
+ PollWithExcludeFields (id = 4 , question = "Question 4" , pub_date = now ()),
25
+ PollWithExcludeFields (id = 5 , question = "Question 5" , pub_date = now ()),
26
+ ]
20
27
21
28
def test_bulk_create_history (self ):
22
29
bulk_create_with_history (self .data , Poll )
@@ -48,7 +55,7 @@ def test_bulk_create_history_with_batch_size(self):
48
55
self .assertEqual (Poll .history .count (), 5 )
49
56
50
57
def test_bulk_create_works_with_excluded_fields (self ):
51
- bulk_create_with_history (self .data , PollWithExcludeFields )
58
+ bulk_create_with_history (self .data_with_excluded_fields , PollWithExcludeFields )
52
59
53
60
self .assertEqual (Poll .objects .count (), 0 )
54
61
self .assertEqual (Poll .history .count (), 0 )
0 commit comments