Skip to content

Commit

Permalink
Fix testing for decimal baths + add testing for new amenities formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-Jess committed Mar 6, 2024
1 parent 9f47afd commit 19a351c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/tests/sublet/test_sublets.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_create_sublet(self):
"title": "Test Sublet1",
"address": "1234 Test Street",
"beds": 2,
"baths": 1,
"baths": "1.5",
"description": "This is a test sublet.",
"external_link": "https://example.com",
"price": 1000,
Expand All @@ -64,6 +64,7 @@ def test_create_sublet(self):
"expires_at",
"start_date",
"end_date",
"amenities",
]
[self.assertEqual(payload[key], res_json[key]) for key in match_keys]
self.assertIn("id", res_json)
Expand Down Expand Up @@ -184,7 +185,7 @@ def test_browse_sublet(self):
"title": "Test Sublet2",
"address": "1234 Test Street",
"beds": 2,
"baths": 1,
"baths": "1.5",
"description": "This is a test sublet.",
"external_link": "https://example.com",
"price": 1000,
Expand All @@ -201,7 +202,8 @@ def test_browse_sublet(self):
self.assertEqual(res_json["title"], "Test Sublet2")
self.assertEqual(res_json["address"], "1234 Test Street")
self.assertEqual(res_json["beds"], 2)
self.assertEqual(res_json["baths"], 1)
self.assertEqual(res_json["baths"], "1.5")
self.assertEqual(res_json["amenities"], ["Amenity1", "Amenity2"])

def test_delete_sublet(self):
sublets_count = Sublet.objects.all().count()
Expand Down

0 comments on commit 19a351c

Please sign in to comment.