"""Push notifications tests.""" from flask import url_for from tests.legacy.apollo_api.factories import StarredContentFactory def test_favorites_tracks(db_session, client, patch_auth_user): user_id_1 = "user_id_1" user_id_2 = "user_id_2" user_id_3 = "user_id_3" StarredContentFactory.create(user_id=user_id_1, isrc="USRC11901901") # 1 StarredContentFactory.create(user_id=user_id_1, isrc="USRC11901902") # 2 StarredContentFactory.create_batch(2, user_id=user_id_1, isrc="USRC11901903") # 3 StarredContentFactory.create(user_id=user_id_2, isrc="USRC11901904") StarredContentFactory.create(user_id=user_id_2, isrc="USRC11901905") StarredContentFactory.create_batch(2, user_id=user_id_2, isrc="USRC11901906") StarredContentFactory.create(user_id=user_id_3, isrc="USRC11901907") # 4 StarredContentFactory.create(user_id=user_id_3, isrc="USRC11901907") StarredContentFactory.create_batch(2, user_id=user_id_3, isrc="USRC11901909") # 5 url = url_for("push_notifications_blueprint.favorites") response = client.get(url) assert response.status_code == 200 assert len(response.json["tracks"]) == 8