def test_check_published_state(self): user = self.get_superuser() version = PageVersionFactory(state=PUBLISHED) placeholder = PlaceholderFactory(source=version.content) self.assertFalse(is_content_editable(placeholder, user))
def test_check_unversioned_model(self): user = self.get_superuser() placeholder = PlaceholderFactory(source=FancyPollFactory()) self.assertTrue(is_content_editable(placeholder, user))
def test_check_draft_state(self): user = self.get_superuser() version = PageVersionFactory(state=DRAFT) placeholder = PlaceholderFactory(source=version.content) self.assertTrue(is_content_editable(placeholder, user))