diff --git a/django/website/rest_api/tests/counts_per_term_tests.py b/django/website/rest_api/tests/counts_per_term_tests.py index d25f03fd7919b83e2c2473e8d555edd364518ef2..8f1979e0e76fce9c2f17e417198dc9f5233b62e8 100644 --- a/django/website/rest_api/tests/counts_per_term_tests.py +++ b/django/website/rest_api/tests/counts_per_term_tests.py @@ -89,6 +89,22 @@ def test_term_count_contains_taxonomy_term_name(questions_category): assert origins['name'] == name +@pytest.mark.django_db +def test_term_count_does_not_contain_term_for_other_taxonomy( + questions_category, regions_category): + origin1 = create_item(body="What was the caused of ebola outbreak in liberia?").data + origins = add_term(taxonomy=questions_category['slug'], name="Test Origins").data + monrovia = add_term(taxonomy=regions_category['slug'], name="Monrovia").data + + categorize_item(origin1, origins) + categorize_item(origin1, monrovia) + + terms = get_term_count(questions_category).data + names = [term['name'] for term in terms] + + assert monrovia['name'] not in names + + @pytest.mark.django_db def test_term_count_contains_taxonomy_term_long_name(questions_category): origin1 = create_item(body="What was the caused of ebola outbreak in liberia?").data