Exemplo n.º 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/'))
Exemplo n.º 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/'))
Exemplo n.º 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/"))
Exemplo n.º 4
0
def follow_feed(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user_id, instance.target_id)
Exemplo n.º 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)
Exemplo n.º 6
0
def follow_feed(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user_id, instance.target_id)
Exemplo n.º 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)
Exemplo n.º 8
0
def follow_listner(sender, instance, created, **kwargs):
    if created:
        feed_manager.follow_user(instance.user.id, instance.target.id)
Exemplo n.º 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)
Exemplo n.º 10
0
def follow_user_feed(follower_id, user_id):
    """
    Task to follow a user feed.
    """
    feed_manager.follow_user(follower_id, user_id)