Skip to content
Snippets Groups Projects
Commit 74f7a277 authored by Martin Burchell's avatar Martin Burchell
Browse files

Replaced Taxonomy is_optional with is_multiple

where the code reads better with is_multiple
parent 943d2e5e
No related branches found
No related tags found
2 merge requests!46Tagging frontend,!45Add multiple terms api
......@@ -44,7 +44,7 @@ class Message(DataLayerModel):
if not all(t.taxonomy == taxonomy for t in terms):
raise ItemTermException("Terms cannot be applied from different taxonomies")
if taxonomy.is_optional:
if not taxonomy.is_multiple:
if len(terms) > 1:
message = "Taxonomy '%s' does not support multiple terms" % taxonomy
raise ItemTermException(message)
......
......@@ -138,7 +138,7 @@ def test_apply_terms_adds_term_for_tags():
taxonomy = TaxonomyFactory(multiplicity='multiple')
term1 = TermFactory(taxonomy=taxonomy)
term2 = TermFactory(taxonomy=taxonomy)
assert not taxonomy.is_optional
assert taxonomy.is_multiple
item.apply_terms(term1)
assert list(item.terms.all()) == [term1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment