コード例 #1
0
 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))
コード例 #2
0
 def test_check_unversioned_model(self):
     user = self.get_superuser()
     placeholder = PlaceholderFactory(source=FancyPollFactory())
     self.assertTrue(is_content_editable(placeholder, user))
コード例 #3
0
 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))