mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-04 22:38:43 +00:00
Python formatting
This commit is contained in:
parent
d9284ede9b
commit
1465385452
1 changed files with 3 additions and 7 deletions
|
@ -80,9 +80,7 @@ class Views(TestCase):
|
||||||
datafile = pathlib.Path(__file__).parent.joinpath("../data/ol_search.json")
|
datafile = pathlib.Path(__file__).parent.joinpath("../data/ol_search.json")
|
||||||
search_data = json.loads(datafile.read_bytes())
|
search_data = json.loads(datafile.read_bytes())
|
||||||
responses.add(
|
responses.add(
|
||||||
responses.GET,
|
responses.GET, "https://example.com/search?q=Test%20Book", json=search_data
|
||||||
"https://example.com/search?q=Test%20Book",
|
|
||||||
json=search_data
|
|
||||||
)
|
)
|
||||||
|
|
||||||
request = self.factory.get("", {"q": "Test Book", "remote": True})
|
request = self.factory.get("", {"q": "Test Book", "remote": True})
|
||||||
|
@ -93,12 +91,10 @@ class Views(TestCase):
|
||||||
self.assertIsInstance(response, TemplateResponse)
|
self.assertIsInstance(response, TemplateResponse)
|
||||||
response.render()
|
response.render()
|
||||||
connector_results = response.context_data["results"]
|
connector_results = response.context_data["results"]
|
||||||
self.assertEqual(
|
self.assertEqual(connector_results[0]["results"][0].title, "Test Book")
|
||||||
connector_results[0]["results"][0].title, "Test Book"
|
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
connector_results[1]["results"][0].title,
|
connector_results[1]["results"][0].title,
|
||||||
"This Is How You Lose the Time War"
|
"This Is How You Lose the Time War",
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_search_users(self):
|
def test_search_users(self):
|
||||||
|
|
Loading…
Reference in a new issue