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
1c2c7d42
Commit
1c2c7d42
authored
9 years ago
by
Martin Burchell
Browse files
Options
Downloads
Patches
Plain Diff
Moved questions category into test fixture
parent
bd8ca7c1
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
+10
-7
10 additions, 7 deletions
django/website/rest_api/tests/counts_per_term_tests.py
with
10 additions
and
7 deletions
django/website/rest_api/tests/counts_per_term_tests.py
+
10
−
7
View file @
1c2c7d42
...
...
@@ -26,8 +26,13 @@ def get_term_count(taxonomy):
return
response
@pytest.fixture
def
questions_category
():
return
create_category
(
"
Test Ebola Questions
"
).
data
@pytest.mark.django_db
def
test_term_count_only_contains_terms_in_taxonomy
():
def
test_term_count_only_contains_terms_in_taxonomy
(
questions_category
):
origin1
=
create_item
(
body
=
"
What was the caused of ebola outbreak in liberia?
"
).
data
origin2
=
create_item
(
body
=
"
Is Ebola a man made sickness
"
).
data
origin3
=
create_item
(
body
=
"
What brought about ebola in liberia
"
).
data
...
...
@@ -37,11 +42,9 @@ def test_term_count_only_contains_terms_in_taxonomy():
updates1
=
create_item
(
body
=
"
When will Liberia be free from Ebola?
"
).
data
updates2
=
create_item
(
body
=
"
Is ebola still here or not?
"
).
data
questions
=
create_category
(
"
Test Ebola Questions
"
).
data
origins
=
add_term
(
taxonomy
=
questions
[
'
slug
'
],
name
=
"
Test Origins
"
).
data
victims
=
add_term
(
taxonomy
=
questions
[
'
slug
'
],
name
=
"
Test Victims
"
).
data
updates
=
add_term
(
taxonomy
=
questions
[
'
slug
'
],
name
=
"
Test Updates
"
).
data
origins
=
add_term
(
taxonomy
=
questions_category
[
'
slug
'
],
name
=
"
Test Origins
"
).
data
victims
=
add_term
(
taxonomy
=
questions_category
[
'
slug
'
],
name
=
"
Test Victims
"
).
data
updates
=
add_term
(
taxonomy
=
questions_category
[
'
slug
'
],
name
=
"
Test Updates
"
).
data
regions
=
create_category
(
"
Regions
"
).
data
monrovia
=
add_term
(
taxonomy
=
regions
[
'
slug
'
],
name
=
"
Monrovia
"
).
data
...
...
@@ -58,7 +61,7 @@ def test_term_count_only_contains_terms_in_taxonomy():
categorize_item
(
origin1
,
monrovia
)
categorize_item
(
updates1
,
monrovia
)
terms
=
get_term_count
(
questions
).
data
terms
=
get_term_count
(
questions
_category
).
data
names
=
[
term
[
'
name
'
]
for
term
in
terms
]
...
...
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