@@ -365,13 +365,15 @@ def test_view_taxonomy_disabled_no_org(self):
365365 )
366366 def test_tag_base_edit_permissions (self , perm ):
367367 """
368- Test that only Staff & Superuser can call add/edit/delete tags.
368+ Test that only Staff & Superuser can call add/edit/delete tags in an
369+ "all orgs" taxonomy.
369370 """
370- assert self .superuser .has_perm (perm )
371- assert self .staff .has_perm (perm )
372- assert not self .user_both_orgs .has_perm (perm )
373- assert not self .user_org2 .has_perm (perm )
374- assert not self .learner .has_perm (perm )
371+ tag = Tag (taxonomy = self .taxonomy_all_orgs )
372+ assert self .superuser .has_perm (perm , tag )
373+ assert self .staff .has_perm (perm , tag )
374+ assert not self .user_both_orgs .has_perm (perm , tag )
375+ assert not self .user_org2 .has_perm (perm , tag )
376+ assert not self .learner .has_perm (perm , tag )
375377
376378 def test_tag_base_view_permissions (self ):
377379 """
@@ -459,14 +461,14 @@ def test_free_text_taxonomy_tag(self, perm):
459461 "oel_tagging.delete_tag" ,
460462 )
461463 def test_tag_no_taxonomy (self , perm ):
462- """Taxonomy administrators can modify any Tag, even those with no Taxonnmy. """
464+ """A "floating" tag with no taxonomy cannot be edited. This shouldn't really happen """
463465 tag = Tag ()
464466
465- # Global Taxonomy Admins can do pretty much anything
467+ # superusers cannot be prevented from doing anything - their permissions check short-circuits our logic.
466468 assert self .superuser .has_perm (perm , tag )
467- assert self .staff .has_perm (perm , tag )
468469
469470 # Everyone else can't do anything
471+ assert not self .staff .has_perm (perm , tag )
470472 assert not self .user_both_orgs .has_perm (perm , tag )
471473 assert not self .user_org2 .has_perm (perm , tag )
472474 assert not self .learner .has_perm (perm , tag )
0 commit comments