Exemple #1
1
    def test_actor_avatar(self):
        avatar = create_content()
        self.api_post('/api/user/change_avatar', {'content_id': avatar.id}, user=self.actor)

        comment = create_quest_comment(author=self.user)
        star_models.star(self.actor, comment)

        sticker = comment.stickers.all()[0]
        stream = ActivityStream(self.user.id, activity_types={StarredActivity.TYPE: StarredActivity})
        activity = StarredActivity.from_sticker(self.actor, sticker)
        stream.push(activity)

        activity, _ = list(self.user.redis.activity_stream)
        self.assertTrue('avatar_url' in activity.to_client()['actor'])
Exemple #2
1
    def test_deactivation(self):
        def cmts():
            return self.api_post('/api/quest_comments/user_comments', {'username': user.username})['comments']

        quest = create_current_quest()
        content = create_content()
        user = create_user()
        comment = self.api_post('/api/quest_comments/post', {
            'quest_id': quest.id,
            'content_id': content.id, 
        }, user=user)['comment']
        self.assertEqual(cmts()[0]['id'], comment['id'])

        self.api_post('/api/auth/actually_deactivate', user=user)
        self.assertFalse(cmts())
    def test_actor_avatar(self):
        avatar = create_content()
        self.api_post('/api/user/change_avatar', {'content_id': avatar.id},
                      user=self.actor)

        comment = create_quest_comment(author=self.user)
        star_models.star(self.actor, comment)

        sticker = comment.stickers.all()[0]
        stream = ActivityStream(self.user.id, activity_types=[StarredActivity])
        activity = StarredActivity.from_sticker(self.actor, sticker)
        stream.push(activity)

        activity, _ = list(self.user.redis.activity_stream)
        self.assertTrue('avatar_url' in activity.to_client()['actor'])
Exemple #4
0
 def after_setUp(self):
     self.quest = create_current_quest()
     self.content = create_content()
     self._enable()
     settings.CACHE_KEY_PREFIX = "DQv" + str(int(settings.CACHE_KEY_PREFIX[-1]) + 1)
 def after_setUp(self):
     self.quest = create_current_quest()
     self.content = create_content()
Exemple #6
0
 def after_setUp(self):
     self.quest = create_current_quest()
     self.content = create_content()
     self._enable()
     settings.CACHE_KEY_PREFIX = 'DQv' + str(int(settings.CACHE_KEY_PREFIX[-1]) + 1)
 def after_setUp(self):
     self.quest = create_current_quest()
     self.content = create_content()