def test_followee_created_ugq(self):
        self.user.follow(self.actor)
        resp = self.api_post('/api/ugq/create_quest', {
            'title': 'Test',
            'content_id': None,
        }, user=self.actor)
        quest = Quest.objects.get(id=resp['quest']['id'])

        stream = ActivityStream(self.user.id, activity_types=[FolloweeCreatedUgqActivity])
        activity = FolloweeCreatedUgqActivity.from_quest(self.actor, quest)
        stream.push(activity)

        activities = list(self.user.redis.activity_stream)
        print activities
        activity = activities[0]
        self.assertEqual(activity.to_client()['quest_id'], quest.id)
    def test_followee_created_ugq(self):
        self.user.follow(self.actor)
        resp = self.api_post('/api/ugq/create_quest', {
            'title': 'Test',
            'content_id': None,
        },
                             user=self.actor)
        quest = Quest.objects.get(id=resp['quest']['id'])

        stream = ActivityStream(self.user.id,
                                activity_types=[FolloweeCreatedUgqActivity])
        activity = FolloweeCreatedUgqActivity.from_quest(self.actor, quest)
        stream.push(activity)

        activities = list(self.user.redis.activity_stream)
        print activities
        activity = activities[0]
        self.assertEqual(activity.to_client()['quest_id'], quest.id)
 def _action_followee_created_ugq(self, notification):
     from drawquest.activities import FolloweeCreatedUgqActivity
     return FolloweeCreatedUgqActivity.from_quest(notification.actor, notification.quest)