Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
internewshid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aptivate
client-projects
internewshid
Commits
ee55db40
Commit
ee55db40
authored
9 years ago
by
Martin Burchell
Browse files
Options
Downloads
Patches
Plain Diff
Added test for wrong taxonomy not in term count
parent
bf450cbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
django/website/rest_api/tests/counts_per_term_tests.py
+16
-0
16 additions, 0 deletions
django/website/rest_api/tests/counts_per_term_tests.py
with
16 additions
and
0 deletions
django/website/rest_api/tests/counts_per_term_tests.py
+
16
−
0
View file @
ee55db40
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment