Exemplo n.º 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()))
Exemplo n.º 2
0
 def test_remove_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(
         reverse('story.remove', kwargs={'pk': story.pk})
     )
Exemplo n.º 3
0
 def test_publish_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(
         reverse('story.publish', kwargs={'pk': story.pk})
     )
Exemplo n.º 4
0
 def test_removed_not(self):
     story = get_story_craft_fair()
     self.assertFalse(get_story_craft_fair().removed)
Exemplo n.º 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)
Exemplo n.º 6
0
 def test_published_not(self):
     story = get_story_craft_fair()
     self.assertFalse(get_story_craft_fair().published)
Exemplo n.º 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)
Exemplo n.º 8
0
 def test_remove_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(reverse('story.remove', kwargs={'pk': story.pk}))
Exemplo n.º 9
0
 def test_publish_perm(self):
     story = get_story_craft_fair()
     self.assert_logged_in(reverse('story.publish', kwargs={'pk':
                                                            story.pk}))