From 74115ccb871b790f548ba4ed032d235320d3edec Mon Sep 17 00:00:00 2001
From: Martin Burchell <martinb@aptivate.org>
Date: Thu, 23 Jul 2015 11:37:08 +0100
Subject: [PATCH] Added test for long name in term count

---
 .../rest_api/tests/counts_per_term_tests.py   | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

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 8c674c90..887c4132 100644
--- a/django/website/rest_api/tests/counts_per_term_tests.py
+++ b/django/website/rest_api/tests/counts_per_term_tests.py
@@ -87,3 +87,27 @@ def test_term_count_contains_taxonomy_term_name(questions_category):
     [name] = [term['name'] for term in terms]
 
     assert origins['name'] == name
+
+
+@pytest.mark.django_db
+def test_term_count_contains_taxonomy_term_name(questions_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
+    categorize_item(origin1, origins)
+
+    terms = get_term_count(questions_category).data
+    [name] = [term['name'] for term in terms]
+
+    assert origins['name'] == name
+
+
+@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
+    origins = add_term(taxonomy=questions_category['slug'], name="Test Origins").data
+    categorize_item(origin1, origins)
+
+    terms = get_term_count(questions_category).data
+    [long_name] = [term['long_name'] for term in terms]
+
+    assert origins['long_name'] == long_name
-- 
GitLab