def politics_first(a, b): a_has_tag = tags.has_tag("australia-news/australian-politics", a) b_has_tag = tags.has_tag("australia-news/australian-politics", b) if a_has_tag and not b_has_tag: return -1 if not a_has_tag and b_has_tag: return 1 return 0
def has_tag(self, tag): return tags.has_tag(self.fullpath, tag)
def test_should_detect_whether_a_tag_present(self): self.assertTrue(tags.has_tag('world/syria', stub_content_item))
def test_should_detect_whether_a_tag_is_absent(self): self.assertFalse(tags.has_tag('world/iraq', stub_content_item))