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
952e07b4
Commit
952e07b4
authored
9 years ago
by
Alice Heaton
Browse files
Options
Downloads
Patches
Plain Diff
Re-introduce test for add_categories
parent
3350f3c1
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/hid/tests/categorize_items_tests.py
+13
-1
13 additions, 1 deletion
django/website/hid/tests/categorize_items_tests.py
with
13 additions
and
1 deletion
django/website/hid/tests/categorize_items_tests.py
+
13
−
1
View file @
952e07b4
...
...
@@ -7,7 +7,7 @@ from taxonomies.tests.factories import TermFactory, TaxonomyFactory
import
transport
from
.views_tests
import
fix_messages
from
..views
import
add_items_categories
from
..views
import
add_items_categories
,
add_categories
ReqFactory
=
RequestFactory
()
...
...
@@ -38,3 +38,15 @@ def test_add_items_categories_adds_term_to_item(term, item):
[
term_data
]
=
item_data
[
'
terms
'
]
assert
term_data
[
'
name
'
]
==
term
.
name
assert
term_data
[
'
taxonomy
'
]
==
term
.
taxonomy
.
slug
@pytest.mark.django_db
def
test_add_categories_adds_term_to_item
(
term
,
item
):
category_list
=
[(
item
[
'
id
'
],
term
.
name
),
]
add_categories
(
category_list
)
[
item_data
]
=
transport
.
items
.
list
()
[
term_data
]
=
item_data
[
'
terms
'
]
assert
term_data
[
'
name
'
]
==
term
.
name
assert
term_data
[
'
taxonomy
'
]
==
term
.
taxonomy
.
slug
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