Example #1
0
 def test_unfollow_user(self):
     httpretty.register_uri(httpretty.DELETE, api_url,
           body='{}', status=200,
           content_type='application/json')
     feed_manager.unfollow_user(1, 2)
     last_req = httpretty.last_request()
     self.assertEqual(last_req.method, 'DELETE')
     self.assertTrue(last_req.path.split('?')[0].endswith('1/follows/user:2/'))
 def test_unfollow_user(self):
     httpretty.register_uri(httpretty.DELETE, api_url,
           body='{}', status=200,
           content_type='application/json')
     feed_manager.unfollow_user(1, 2)
Example #3
0
def unfollow_feed(sender, instance, **kwargs):
    feed_manager.unfollow_user(instance.user_id, instance.target_id)
Example #4
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)