Skip to content

Commit

Permalink
Fix pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Nov 11, 2020
1 parent ba23133 commit 779d558
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,9 @@ def test_create_database_uri_validate(self):
rv = self.client.post(uri, json=database_data)
response = json.loads(rv.data.decode("utf-8"))
self.assertEqual(rv.status_code, 400)
expected_response = {
"message": {
"sqlalchemy_uri": [
"Invalid connection string, a valid string usually "
"follows:'DRIVER://USER:PASSWORD@DB-HOST/DATABASE-NAME'"
"<p>Example:'postgresql://user:password@your-postgres-db/database'"
"</p>"
]
}
}
self.assertEqual(response, expected_response)
self.assertIn(
"Invalid connection string", response["message"]["sqlalchemy_uri"][0],
)

def test_create_database_fail_sqllite(self):
"""
Expand Down Expand Up @@ -456,17 +448,9 @@ def test_update_database_uri_validate(self):
rv = self.client.put(uri, json=database_data)
response = json.loads(rv.data.decode("utf-8"))
self.assertEqual(rv.status_code, 400)
expected_response = {
"message": {
"sqlalchemy_uri": [
"Invalid connection string, a valid string usually "
"follows:'DRIVER://USER:PASSWORD@DB-HOST/DATABASE-NAME'"
"<p>Example:'postgresql://user:password@your-postgres-db/database'"
"</p>"
]
}
}
self.assertEqual(response, expected_response)
self.assertIn(
"Invalid connection string", response["message"]["sqlalchemy_uri"][0],
)

def test_delete_database(self):
"""
Expand Down

0 comments on commit 779d558

Please sign in to comment.