def check_user_subscribed_only_to_streams(self, user_name: str, streams: List[Stream]) -> None: streams = sorted(streams, key=lambda x: x.name) subscribed_streams = gather_subscriptions(self.nonreg_user(user_name))[0] self.assertEqual(len(subscribed_streams), len(streams)) for x, y in zip(subscribed_streams, streams): self.assertEqual(x["name"], y.name)
def list_subscriptions_backend(request, user_profile): # type: (HttpRequest, UserProfile) -> HttpResponse return json_success({"subscriptions": gather_subscriptions(user_profile)[0]})
def list_subscriptions_backend(request, user_profile): return json_success({"subscriptions": gather_subscriptions(user_profile)[0]})
def list_subscriptions_backend(request, user_profile): return json_success( {"subscriptions": gather_subscriptions(user_profile)[0]})