diff --git a/bookwyrm/connectors/settings.py b/bookwyrm/connectors/settings.py index 4cc98da7f..927e39b26 100644 --- a/bookwyrm/connectors/settings.py +++ b/bookwyrm/connectors/settings.py @@ -1,3 +1,3 @@ """ settings book data connectors """ -CONNECTORS = ["openlibrary", "inventaire", "self_connector", "bookwyrm_connector"] +CONNECTORS = ["openlibrary", "inventaire", "bookwyrm_connector"] diff --git a/bookwyrm/management/commands/initdb.py b/bookwyrm/management/commands/initdb.py index 9f2f29cda..d0ab648e0 100644 --- a/bookwyrm/management/commands/initdb.py +++ b/bookwyrm/management/commands/initdb.py @@ -4,7 +4,6 @@ from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from bookwyrm.models import Connector, FederatedServer, SiteSettings, User -from bookwyrm.settings import DOMAIN def init_groups(): diff --git a/bookwyrm/tests/connectors/test_connector_manager.py b/bookwyrm/tests/connectors/test_connector_manager.py index 186f918bf..d6d82fc8c 100644 --- a/bookwyrm/tests/connectors/test_connector_manager.py +++ b/bookwyrm/tests/connectors/test_connector_manager.py @@ -50,17 +50,18 @@ class ConnectorManager(TestCase): self.assertIsInstance(connectors[0], BookWyrmConnector) @responses.activate - def test_search(self): + def test_search_plaintext(self): """search all connectors""" responses.add( responses.GET, "http://fake.ciom/search/Example?min_confidence=0.1", - json={}, + json=[{"title": "Hello", "key": "https://www.example.com/search/1"}], ) results = connector_manager.search("Example") self.assertEqual(len(results), 1) self.assertEqual(len(results[0]["results"]), 1) - self.assertEqual(results[0]["results"][0].title, "Example Edition") + self.assertEqual(results[0]["connector"].identifier, "test_connector_remote") + self.assertEqual(results[0]["results"][0].title, "Hello") def test_search_empty_query(self): """don't panic on empty queries""" @@ -73,12 +74,13 @@ class ConnectorManager(TestCase): responses.add( responses.GET, "http://fake.ciom/isbn/0000000000", - json={}, + json=[{"title": "Hello", "key": "https://www.example.com/search/1"}], ) results = connector_manager.search("0000000000") self.assertEqual(len(results), 1) self.assertEqual(len(results[0]["results"]), 1) - self.assertEqual(results[0]["results"][0].title, "Example Edition") + self.assertEqual(results[0]["connector"].identifier, "test_connector_remote") + self.assertEqual(results[0]["results"][0].title, "Hello") def test_first_search_result(self): """only get one search result"""