@@ -131,7 +131,7 @@ class TestChangeSet:
131131 def test_create_dependencies_accept (self , normalized_data_id , create_graph_dependencies ):
132132 change_set = models .ChangeSet .objects .from_graph (create_graph_dependencies , normalized_data_id )
133133
134- assert change_set .changes .exact_count () == 3
134+ assert change_set .changes .count () == 3
135135 assert change_set .changes .all ()[0 ].node_id == '_:123'
136136 assert change_set .changes .all ()[1 ].node_id == '_:789'
137137 assert change_set .changes .all ()[2 ].node_id == '_:456'
@@ -175,7 +175,7 @@ def test_update_dependencies_accept(self, john_doe, normalized_data_id):
175175 john_doe .refresh_from_db ()
176176
177177 assert john_doe .given_name == 'Jane'
178- assert models .Preprint .objects .filter (agent_relations__agent = john_doe ).exact_count () == 1
178+ assert models .Preprint .objects .filter (agent_relations__agent = john_doe ).count () == 1
179179 assert models .Preprint .objects .filter (agent_relations__agent = john_doe ).first ().title == 'All About Cats'
180180
181181 @pytest .mark .django_db
@@ -231,9 +231,9 @@ def test_can_delete_work(self, john_doe, normalized_data_id):
231231 # }]
232232 # }), normalized_data_id).accept()
233233
234- # assert Preprint.objects.filter(contributor__person=john_doe).exact_count () == 1
235- # assert Preprint.objects.filter(contributor__person=john_doe).exact_count () == 1
236- # assert Preprint.objects.filter(contributor__person=jane_doe).exact_count () == 0
234+ # assert Preprint.objects.filter(contributor__person=john_doe).count () == 1
235+ # assert Preprint.objects.filter(contributor__person=john_doe).count () == 1
236+ # assert Preprint.objects.filter(contributor__person=jane_doe).count () == 0
237237
238238 # change_set.accept()
239239
@@ -242,10 +242,10 @@ def test_can_delete_work(self, john_doe, normalized_data_id):
242242
243243 # # Jane should not have been modified
244244 # assert jane_doe.same_as is None
245- # assert jane_doe.versions.exact_count () == 1
245+ # assert jane_doe.versions.count () == 1
246246
247247 # # John should have been updated
248- # assert john_doe.versions.exact_count () == 2
248+ # assert john_doe.versions.count () == 2
249249
250250 # # John's same_as field and same_as_version should have been updated
251251 # assert john_doe.same_as == jane_doe
@@ -261,15 +261,15 @@ def test_can_delete_work(self, john_doe, normalized_data_id):
261261 # assert john_doe.versions.first().date_modified > john_doe.versions.last().date_modified
262262
263263 # # John is no longer a contributor on anything
264- # assert Preprint.objects.filter(contributor__person=john_doe).exact_count () == 0
265- # assert Preprint.objects.filter(contributor__person_version=john_doe.version).exact_count () == 0
264+ # assert Preprint.objects.filter(contributor__person=john_doe).count () == 0
265+ # assert Preprint.objects.filter(contributor__person_version=john_doe.version).count () == 0
266266
267267 # # Jane is now a contributor
268- # assert Preprint.objects.filter(contributor__person=jane_doe).exact_count () == 1
269- # assert Preprint.objects.filter(contributor__person_version=jane_doe.version).exact_count () == 1
268+ # assert Preprint.objects.filter(contributor__person=jane_doe).count () == 1
269+ # assert Preprint.objects.filter(contributor__person_version=jane_doe.version).count () == 1
270270
271271 # # The affected contributor should have been updated
272- # assert Contributor.objects.get(person=jane_doe).versions.exact_count () == 2
272+ # assert Contributor.objects.get(person=jane_doe).versions.count () == 2
273273 # assert Contributor.objects.get(person=jane_doe).change.change_set == change_set
274274
275275 @pytest .mark .django_db
@@ -278,7 +278,7 @@ def test_accept_subject(self, normalized_data_id):
278278 models .Subject (name = 'Felines' )
279279 ])
280280
281- assert models .Subject .objects .filter (name = 'Felines' ).exact_count () == 1
281+ assert models .Subject .objects .filter (name = 'Felines' ).count () == 1
282282
283283 graph = ChangeGraph ([{
284284 '@id' : '_:987' ,
@@ -300,7 +300,7 @@ def test_accept_subject(self, normalized_data_id):
300300
301301 change_set .accept ()
302302
303- assert models .Preprint .objects .filter (subjects__name = 'Felines' ).exact_count () == 1
303+ assert models .Preprint .objects .filter (subjects__name = 'Felines' ).count () == 1
304304 assert models .Preprint .objects .filter (subjects__name = 'Felines' ).first ().title == 'All About Cats'
305305
306306 @pytest .mark .django_db
@@ -354,10 +354,10 @@ def test_change_work_type(self, normalized_data_id):
354354 id = work .id
355355
356356 assert identifier .uri == uri
357- assert models .Project .objects .exact_count () == 1
358- assert models .Preprint .objects .exact_count () == 0
359- assert models .CreativeWork .objects .exact_count () == 1
360- assert models .Project .objects .all ()[0 ].changes .exact_count () == 1
357+ assert models .Project .objects .count () == 1
358+ assert models .Preprint .objects .count () == 0
359+ assert models .CreativeWork .objects .count () == 1
360+ assert models .Project .objects .all ()[0 ].changes .count () == 1
361361
362362 cg = ChangeGraph ([{
363363 '@id' : '_:1234' ,
@@ -375,11 +375,11 @@ def test_change_work_type(self, normalized_data_id):
375375
376376 change_set .accept ()
377377
378- assert models .Project .objects .exact_count () == 0
379- assert models .Preprint .objects .exact_count () == 1
380- assert models .CreativeWork .objects .exact_count () == 1
378+ assert models .Project .objects .count () == 0
379+ assert models .Preprint .objects .count () == 1
380+ assert models .CreativeWork .objects .count () == 1
381381 assert models .Preprint .objects .get (id = id ).title == title
382- assert models .Preprint .objects .all ()[0 ].changes .exact_count () == 2
382+ assert models .Preprint .objects .all ()[0 ].changes .count () == 2
383383
384384 @pytest .mark .django_db
385385 def test_generic_creative_work (self , normalized_data_id ):
@@ -408,8 +408,8 @@ def test_generic_creative_work(self, normalized_data_id):
408408 id = preprint .id
409409
410410 assert identifier .uri == uri
411- assert models .Preprint .objects .exact_count () == 1
412- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 0
411+ assert models .Preprint .objects .count () == 1
412+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 0
413413 assert models .Preprint .objects .get (id = id ).title == old_title
414414
415415 new_title = 'Ambidextrous Earthquakes'
@@ -430,8 +430,8 @@ def test_generic_creative_work(self, normalized_data_id):
430430 change_set = models .ChangeSet .objects .from_graph (graph , normalized_data_id )
431431 change_set .accept ()
432432
433- assert models .Preprint .objects .exact_count () == 1
434- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 0
433+ assert models .Preprint .objects .count () == 1
434+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 0
435435 assert models .Preprint .objects .get (id = id ).title == new_title
436436
437437 @pytest .mark .django_db
@@ -464,18 +464,18 @@ def test_related_works(self, normalized_data_id):
464464 }]), normalized_data_id )
465465 change_set .accept ()
466466
467- assert models .Preprint .objects .exact_count () == 1
468- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 1
467+ assert models .Preprint .objects .count () == 1
468+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 1
469469
470470 p = models .Preprint .objects .first ()
471471 c = models .AbstractCreativeWork .objects .get (title = 'Cats, tho' )
472472
473- assert p .related_works .exact_count () == 1
473+ assert p .related_works .count () == 1
474474 assert p .related_works .first () == c
475- assert p .outgoing_creative_work_relations .exact_count () == 1
475+ assert p .outgoing_creative_work_relations .count () == 1
476476 assert p .outgoing_creative_work_relations .first ()._meta .model_name == 'cites'
477477 assert p .outgoing_creative_work_relations .first ().related == c
478- assert c .incoming_creative_work_relations .exact_count () == 1
478+ assert c .incoming_creative_work_relations .count () == 1
479479 assert c .incoming_creative_work_relations .first ()._meta .model_name == 'cites'
480480 assert c .incoming_creative_work_relations .first ().subject == p
481481
@@ -500,7 +500,7 @@ def test_add_relation_related(self, normalized_data_id):
500500 'creative_work' : {'@id' : '_:1234' , '@type' : 'article' }
501501 }]), normalized_data_id ).accept ()
502502
503- assert models .Article .objects .exact_count () == 1
503+ assert models .Article .objects .count () == 1
504504
505505 graph = ChangeGraph ([{
506506 '@id' : '_:1234' ,
@@ -526,17 +526,17 @@ def test_add_relation_related(self, normalized_data_id):
526526 change_set = models .ChangeSet .objects .from_graph (graph , normalized_data_id )
527527 change_set .accept ()
528528
529- assert models .Article .objects .exact_count () == 1
530- assert models .Preprint .objects .exact_count () == 1
531- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 0
529+ assert models .Article .objects .count () == 1
530+ assert models .Preprint .objects .count () == 1
531+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 0
532532
533533 cat = models .Article .objects .first ()
534534 dog = models .Preprint .objects .first ()
535535
536- assert dog .outgoing_creative_work_relations .exact_count () == 1
536+ assert dog .outgoing_creative_work_relations .count () == 1
537537 assert dog .outgoing_creative_work_relations .first ()._meta .model_name == 'cites'
538538 assert dog .outgoing_creative_work_relations .first ().related == cat
539- assert cat .incoming_creative_work_relations .exact_count () == 1
539+ assert cat .incoming_creative_work_relations .count () == 1
540540 assert cat .incoming_creative_work_relations .first ()._meta .model_name == 'cites'
541541 assert cat .incoming_creative_work_relations .first ().subject == dog
542542
@@ -573,9 +573,9 @@ def test_add_work_with_existing_relation(self, normalized_data_id):
573573 'creative_work' : {'@id' : '_:2345' , '@type' : 'creativework' }
574574 }]), normalized_data_id ).accept ()
575575
576- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 1
577- assert models .Preprint .objects .exact_count () == 1
578- assert models .Article .objects .exact_count () == 0
576+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 1
577+ assert models .Preprint .objects .count () == 1
578+ assert models .Article .objects .count () == 0
579579
580580 change = ChangeGraph ([{
581581 '@id' : '_:1234' ,
@@ -592,17 +592,17 @@ def test_add_work_with_existing_relation(self, normalized_data_id):
592592
593593 models .ChangeSet .objects .from_graph (change , normalized_data_id ).accept ()
594594
595- assert models .CreativeWork .objects .filter (type = 'share.creativework' ).exact_count () == 0
596- assert models .Article .objects .exact_count () == 1
597- assert models .Preprint .objects .exact_count () == 1
595+ assert models .CreativeWork .objects .filter (type = 'share.creativework' ).count () == 0
596+ assert models .Article .objects .count () == 1
597+ assert models .Preprint .objects .count () == 1
598598
599599 cat = models .Article .objects .first ()
600600 dog = models .Preprint .objects .first ()
601601
602- assert dog .outgoing_creative_work_relations .exact_count () == 1
602+ assert dog .outgoing_creative_work_relations .count () == 1
603603 assert dog .outgoing_creative_work_relations .first ()._meta .model_name == 'cites'
604604 assert dog .outgoing_creative_work_relations .first ().related == cat
605- assert cat .incoming_creative_work_relations .exact_count () == 1
605+ assert cat .incoming_creative_work_relations .count () == 1
606606 assert cat .incoming_creative_work_relations .first ()._meta .model_name == 'cites'
607607 assert cat .incoming_creative_work_relations .first ().subject == dog
608608
@@ -629,7 +629,7 @@ def test_work_type_stays_nongeneric(self, change_factory, all_about_anteaters):
629629 }, disambiguate = True )
630630
631631 assert all_about_anteaters .type == 'share.article'
632- assert models .Publication .objects .exact_count () == 1
632+ assert models .Publication .objects .count () == 1
633633
634634 cs .accept ()
635635 all_about_anteaters .refresh_from_db ()
@@ -646,13 +646,13 @@ def test_change_agent_type(self, change_factory, university_of_whales):
646646 }]
647647 }, disambiguate = True )
648648
649- assert models .Institution .objects .exact_count () == 1
650- assert models .Consortium .objects .exact_count () == 0
649+ assert models .Institution .objects .count () == 1
650+ assert models .Consortium .objects .count () == 0
651651
652652 (org ,) = cs .accept ()
653653
654654 assert org .type == 'share.consortium'
655655 assert org .id == university_of_whales .id
656656 assert org .name == university_of_whales .name
657- assert models .Institution .objects .exact_count () == 0
658- assert models .Consortium .objects .exact_count () == 1
657+ assert models .Institution .objects .count () == 0
658+ assert models .Consortium .objects .count () == 1
0 commit comments