Ejemplo n.º 1
0
    def test_imagerevision_post_save(self, add_story):
        revision = Generators.imageRevision()

        add_story.reset_mock()

        imagerevision_post_save(None, revision, True)

        self.assertTrue(add_story.called)
Ejemplo n.º 2
0
    def test_imagerevision_post_save_not_created_no_notifications(self, add_story, push_notification):
        revision = Generators.imageRevision()

        push_notification.reset_mock()
        add_story.reset_mock()

        imagerevision_post_save(None, revision, False)

        self.assertFalse(push_notification.called)
        self.assertFalse(add_story.called)
Ejemplo n.º 3
0
    def test_imagerevision_post_save(self, add_story, push_notification):
        revision = Generators.imageRevision()

        push_notification.reset_mock()
        add_story.reset_mock()

        imagerevision_post_save(None, revision, True)

        self.assertTrue(push_notification.called)
        self.assertTrue(add_story.called)
Ejemplo n.º 4
0
    def test_imagerevision_post_save_wip_no_notifications(self, add_story, push_notification):
        revision = Generators.imageRevision()
        revision.image.is_wip = True

        push_notification.reset_mock()
        add_story.reset_mock()

        imagerevision_post_save(None, revision, True)

        self.assertFalse(push_notification.called)
        self.assertFalse(add_story.called)
Ejemplo n.º 5
0
    def test_imagerevision_post_save_uploading(self, add_story,
                                               push_notification):
        revision = Generators.imageRevision()
        revision.uploader_in_progress = True

        push_notification.reset_mock()
        add_story.reset_mock()

        imagerevision_post_save(None, revision, True)

        self.assertFalse(push_notification.called)
        self.assertFalse(add_story.called)