Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark committed Aug 13, 2024
1 parent 9717c38 commit 4c50e6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions explorer/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_remove_unused_sqlite_dbs(self, MockDatabaseConnection, MockQueryLog):
mock_queryset.first.return_value = query_log1

def filter_side_effect(*args, **kwargs):
if kwargs.get("database_connection") == 3:
if kwargs.get("database_connection") == 3: # noqa: PLR2004
return mock_queryset
return MagicMock(first=MagicMock(return_value=None))

Expand Down Expand Up @@ -163,7 +163,7 @@ def test_do_not_remove_recently_used_db(self, MockDatabaseConnection, MockQueryL
mock_queryset.first.return_value = query_log1

def filter_side_effect(*args, **kwargs):
if kwargs.get("database_connection") == 3:
if kwargs.get("database_connection") == 3: # noqa: PLR2004
return mock_queryset
return MagicMock(first=MagicMock(return_value=None))

Expand Down
3 changes: 2 additions & 1 deletion explorer/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,8 @@ def test_database_connection_error(self, mock_load):
mock_load.side_effect = DatabaseError("Connection error")
response = self.client.post(self.url, data=self.valid_data)
self.assertEqual(response.status_code, 200)
self.assertJSONEqual(response.content, {"success": False, "error": "Failed to create explorer connection: Connection error"})
self.assertJSONEqual(response.content, {"success": False,
"error": "Failed to create explorer connection: Connection error"})


# The idea is to render all of these views, to ensure that errors haven't been introduced in the templates
Expand Down

0 comments on commit 4c50e6e

Please sign in to comment.