Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit test assertion fixes #1203

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ihatemoney/tests/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ def test_project(self):
},
)

self.assertTrue(400, resp.status_code)
self.assertEqual(400, resp.status_code)
self.assertEqual(
'{"contact_email": ["Invalid email address."]}\n', resp.data.decode("utf-8")
)

# create it
with self.app.mail.record_messages() as outbox:
resp = self.api_create("raclette")
self.assertTrue(201, resp.status_code)
self.assertEqual(201, resp.status_code)

# Check that email messages have been sent.
self.assertEqual(len(outbox), 1)
Expand All @@ -111,15 +111,15 @@ def test_project(self):
# create it twice should return a 400
resp = self.api_create("raclette")

self.assertTrue(400, resp.status_code)
self.assertEqual(400, resp.status_code)
self.assertIn("id", json.loads(resp.data.decode("utf-8")))

# get information about it
resp = self.client.get(
"/api/projects/raclette", headers=self.get_auth("raclette")
)

self.assertTrue(200, resp.status_code)
self.assertEqual(200, resp.status_code)
expected = {
"members": [],
"name": "raclette",
Expand Down Expand Up @@ -197,7 +197,7 @@ def test_token_creation(self):

# Create project
resp = self.api_create("raclette")
self.assertTrue(201, resp.status_code)
self.assertEqual(201, resp.status_code)

# Get token
resp = self.client.get(
Expand Down Expand Up @@ -577,19 +577,19 @@ def test_bills_with_calculation(self):
def test_currencies(self):
# check /currencies for list of supported currencies
resp = self.client.get("/api/currencies")
self.assertTrue(201, resp.status_code)
self.assertEqual(200, resp.status_code)
self.assertIn("XXX", json.loads(resp.data.decode("utf-8")))

# create project with a default currency
resp = self.api_create("raclette", default_currency="EUR")
self.assertTrue(201, resp.status_code)
self.assertEqual(201, resp.status_code)

# get information about it
resp = self.client.get(
"/api/projects/raclette", headers=self.get_auth("raclette")
)

self.assertTrue(200, resp.status_code)
self.assertEqual(200, resp.status_code)
expected = {
"members": [],
"name": "raclette",
Expand Down