def test_does_not_count_duplicates(self): nominator = factories.NominatorFactory() factories.NominatedURLFactory.create_batch(5, value=1, url_nominator=nominator) url_query_set = models.URL.objects.all() result = views.get_project_nominator_count(url_query_set) assert result == 1
def test_returns_nominator_count(self): factories.NominatedURLFactory.create_batch(10, value=1) # Other URLs that have not been nominated should not affect the # nominator count. factories.URLFactory.create_batch(5) url_query_set = models.URL.objects.all() result = views.get_project_nominator_count(url_query_set) assert result == 10