diff --git a/tests/frontend/test_user.py b/tests/frontend/test_user.py index dff2f5f..d65b1dc 100644 --- a/tests/frontend/test_user.py +++ b/tests/frontend/test_user.py @@ -255,18 +255,6 @@ class UserTestCase(FrontendTestBase): rv = self.client.get("/user/me/lastfm/unlink", follow_redirects=True) self.assertIn("Unlinked", rv.data) - def test_listenbrainz_link(self): - self._login("alice", "Alic3") - rv = self.client.get("/user/me/listenbrainz/link", follow_redirects=True) - self.assertIn("Missing ListenBrainz auth token", rv.data) - # # Testing this requires an HTTP request! - # rv = self.client.get( - # "/user/me/listenbrainz/link", - # query_string={"token": "abcdef"}, - # follow_redirects=True, - # ) - # self.assertIn("Error: ", rv.data) - def test_listenbrainz_unlink(self): self._login("alice", "Alic3") rv = self.client.get("/user/me/listenbrainz/unlink", follow_redirects=True) diff --git a/tests/net/test_listenbrainz.py b/tests/net/test_listenbrainz.py index abd2031..6486ad1 100644 --- a/tests/net/test_listenbrainz.py +++ b/tests/net/test_listenbrainz.py @@ -11,6 +11,8 @@ import unittest from supysonic.listenbrainz import ListenBrainz +from ..frontend.frontendtestbase import FrontendTestBase + class ListenBrainzTestCase(unittest.TestCase): """Basic test of unauthenticated ListenBrainz API method""" @@ -22,5 +24,18 @@ class ListenBrainzTestCase(unittest.TestCase): rv = listenbrainz._ListenBrainz__api_request(False, "/1/search/users/?search_term={0}".format(user), token="123") self.assertIsInstance(rv, dict) +class FrontendListenBrainzCase(FrontendTestBase): + def test_listenbrainz_link(self): + self._login("alice", "Alic3") + rv = self.client.get("/user/me/listenbrainz/link", follow_redirects=True) + self.assertIn("Missing ListenBrainz auth token", rv.data) + rv = self.client.get( + "/user/me/listenbrainz/link", + query_string={"token": "abcdef"}, + follow_redirects=True, + ) + self.assertIn("Error: ", rv.data) + + if __name__ == "__main__": unittest.main()