Beispiel #1
0
    def test_pleb_does_not_exist(self):
        data = {
            "object_uuid": self.question.object_uuid,
            "previous_vote_type": 1,
            "new_vote_type": 0,
            "voting_pleb": str(uuid1())
        }
        res = object_vote_notifications.apply_async(kwargs=data)
        while not res.ready():
            time.sleep(1)

        self.assertIsInstance(res.result, Exception)
Beispiel #2
0
    def test_neg_rep_change(self):
        data = {
            "object_uuid": self.question.object_uuid,
            "previous_vote_type": 1,
            "new_vote_type": 0,
            "voting_pleb": self.pleb.username
        }
        res = object_vote_notifications.apply_async(kwargs=data)
        while not res.ready():
            time.sleep(1)

        self.assertTrue(res.result)
        self.assertNotIsInstance(res.result, Exception)
Beispiel #3
0
    def test_initial_vote_create_private_content(self):
        post = Post(content='test content').save()
        data = {
            "object_uuid": post.object_uuid,
            "previous_vote_type": None,
            "new_vote_type": 1,
            "voting_pleb": self.pleb.username
        }

        res = object_vote_notifications.apply_async(kwargs=data)
        while not res.ready():
            time.sleep(1)
        self.assertTrue(res.result)
        self.assertNotIsInstance(res.result, Exception)