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
5b4df219
Commit
5b4df219
authored
9 years ago
by
Martin Burchell
Browse files
Options
Downloads
Patches
Plain Diff
Fixed API tests that assumed free-tags taxonomy
parent
6fcd14c4
No related branches found
Branches containing commit
No related tags found
1 merge request
!46
Tagging frontend
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
django/website/rest_api/tests/free_tagging_tests.py
+4
-4
4 additions, 4 deletions
django/website/rest_api/tests/free_tagging_tests.py
django/website/transport/tests/free_tagging_tests.py
+3
-3
3 additions, 3 deletions
django/website/transport/tests/free_tagging_tests.py
with
7 additions
and
7 deletions
django/website/rest_api/tests/free_tagging_tests.py
+
4
−
4
View file @
5b4df219
...
...
@@ -39,7 +39,7 @@ def add_free_terms_to_item(item_id, terms):
@pytest.mark.django_db
def
test_multiple_new_terms_applied_to_item
(
item
):
terms
=
{
'
taxonomy
'
:
'
free-
tags
'
,
'
taxonomy
'
:
'
tags
'
,
'
name
'
:
[
'
Monrovia
'
,
'
age 35-40
'
],
}
...
...
@@ -53,9 +53,9 @@ def test_multiple_new_terms_applied_to_item(item):
taxonomy_terms
[
term
[
'
taxonomy
'
]]
=
[]
taxonomy_terms
[
term
[
'
taxonomy
'
]].
append
(
term
[
'
name
'
])
assert
'
free-
tags
'
in
taxonomy_terms
assert
'
Monrovia
'
in
taxonomy_terms
[
'
free-
tags
'
]
assert
'
age 35-40
'
in
taxonomy_terms
[
'
free-
tags
'
]
assert
'
tags
'
in
taxonomy_terms
assert
'
Monrovia
'
in
taxonomy_terms
[
'
tags
'
]
assert
'
age 35-40
'
in
taxonomy_terms
[
'
tags
'
]
@pytest.mark.django_db
...
...
This diff is collapsed.
Click to expand it.
django/website/transport/tests/free_tagging_tests.py
+
3
−
3
View file @
5b4df219
...
...
@@ -13,7 +13,7 @@ def test_multiple_new_terms_applied_to_item():
term_names
=
[
'
Monrovia
'
,
'
age 40-45
'
,
'
pertinent
'
]
item
=
items
.
add_free_terms
(
item
[
'
id
'
],
'
free-
tags
'
,
term_names
)
item
[
'
id
'
],
'
tags
'
,
term_names
)
stored_names
=
[
t
[
'
name
'
]
for
t
in
item
[
'
terms
'
]]
...
...
@@ -26,7 +26,7 @@ def test_add_free_terms_raises_transport_exception_if_item_absent():
term_names
=
[
'
Monrovia
'
,
'
age 40-45
'
,
'
pertinent
'
]
with
pytest
.
raises
(
TransportException
)
as
excinfo
:
items
.
add_free_terms
(
unknown_item_id
,
'
free-
tags
'
,
term_names
)
items
.
add_free_terms
(
unknown_item_id
,
'
tags
'
,
term_names
)
error
=
excinfo
.
value
.
message
...
...
@@ -34,7 +34,7 @@ def test_add_free_terms_raises_transport_exception_if_item_absent():
assert
error
[
'
detail
'
]
==
"
Message matching query does not exist.
"
assert
error
[
'
item_id
'
]
==
unknown_item_id
assert
error
[
'
terms
'
][
'
name
'
]
==
term_names
assert
error
[
'
terms
'
][
'
taxonomy
'
]
==
'
free-
tags
'
assert
error
[
'
terms
'
][
'
taxonomy
'
]
==
'
tags
'
@pytest.mark.django_db
...
...
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