Example #1
0
 def test_can_edit_not(self):
     """
     A story can only be edited by the person who created it (or a member
     of staff).  The craft fair story was created by an anonymous user.
     """
     story = get_story_craft_fair()
     self.assertFalse(story.user_can_edit(get_user_web()))
Example #2
0
 def test_remove_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(
         reverse('story.remove', kwargs={'pk': story.pk})
     )
Example #3
0
 def test_publish_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(
         reverse('story.publish', kwargs={'pk': story.pk})
     )
Example #4
0
 def test_removed_not(self):
     story = get_story_craft_fair()
     self.assertFalse(get_story_craft_fair().removed)
Example #5
0
 def test_removed(self):
     story = get_story_craft_fair()
     story.set_removed(get_user_staff())
     story.save()
     self.assertTrue(get_story_craft_fair().removed)
Example #6
0
 def test_published_not(self):
     story = get_story_craft_fair()
     self.assertFalse(get_story_craft_fair().published)
Example #7
0
 def test_published(self):
     story = get_story_craft_fair()
     story.set_published(get_user_staff())
     story.save()
     self.assertTrue(get_story_craft_fair().published)
Example #8
0
 def test_remove_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(reverse('story.remove', kwargs={'pk': story.pk}))
Example #9
0
 def test_publish_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(reverse('story.publish', kwargs={'pk':
                                                            story.pk}))