Пример #1
0
 def test_follow_user(self):
     httpretty.register_uri(httpretty.POST, api_url,
           body='{}', status=200,
           content_type='application/json')
     feed_manager.follow_user(1, 2)
     last_req = httpretty.last_request()
     self.assertTrue(last_req.path.split('?')[0].endswith('1/follows/'))
Пример #2
0
 def test_follow_user(self):
     httpretty.register_uri(httpretty.POST, api_url,
           body='{}', status=200,
           content_type='application/json')
     feed_manager.follow_user(1, 2)
     last_req = httpretty.last_request()
     self.assertTrue(last_req.path.split('?')[0].endswith('1/follows/'))
Пример #3
0
 def test_follow_user(self):
     httpretty.register_uri(
         httpretty.POST,
         api_url,
         body="{}",
         status=200,
         content_type="application/json",
     )
     feed_manager.follow_user(1, 2)
     last_req = httpretty.last_request()
     self.assertTrue(last_req.path.split("?")[0].endswith("1/follows/"))
Пример #4
0
def follow_feed(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user_id, instance.target_id)
Пример #5
0
 def test_follow_user(self):
     httpretty.register_uri(httpretty.POST, api_url,
           body='{}', status=200,
           content_type='application/json')
     feed_manager.follow_user(1, 2)
Пример #6
0
def follow_feed(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user_id, instance.target_id)
Пример #7
0
def follow_change(sender, instance, created, **kwargs):
    if instance.deleted_at is None:
        feed_manager.follow_user(instance.user_id, instance.target_id)
    else:
        feed_manager.unfollow_user(instance.user_id, instance.target_id)
Пример #8
0
def follow_listner(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user.id, instance.target.id)
Пример #9
0
def follow_change(sender, instance, created, **kwargs):
    if instance.deleted_at is None:
        feed_manager.follow_user(instance.user_id, instance.target_id)
    else:
        feed_manager.unfollow_user(instance.user_id, instance.target_id)
Пример #10
0
def follow_user_feed(follower_id, user_id):
    """
    Task to follow a user feed.
    """
    feed_manager.follow_user(follower_id, user_id)