Fakultas Ilmu Komputer UI

Commit 7a84e931 authored by PRIMO GIANCARLO UNEPUTTY's avatar PRIMO GIANCARLO UNEPUTTY
Browse files

test: Added more assertion checks in Investasi tests

parent 6f098821
......@@ -158,6 +158,9 @@ class InvestasiTest(TestCase):
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['pembeli'], None)
self.assertEqual(response.json()['statusPembelian'], 'BDB')
self.assertEqual(response.json()['statusInvestasi'], 'DJL')
response = self.client.get(
'/api/investasi/penjualan/',
......@@ -202,6 +205,9 @@ class InvestasiTest(TestCase):
HTTP_AUTHORIZATION="JWT {}".format(token)
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['pembeli'], None)
self.assertEqual(response.json()['statusPembelian'], 'BDB')
self.assertEqual(response.json()['statusInvestasi'], 'DMK')
response = self.client.get(
'/api/investasi/penjualan/',
......@@ -357,6 +363,7 @@ class InvestasiTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['pembeli'], user.email)
self.assertEqual(response.json()['statusPembelian'], 'MPA')
self.assertEqual(response.json()['statusInvestasi'], 'SDB')
def test_cancel_beli_investasi_fail(self):
investasi = Investasi(investor=self.user, pengadaan=self.pengadaan, nominal=1)
......@@ -414,6 +421,7 @@ class InvestasiTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['pembeli'], None)
self.assertEqual(response.json()['statusPembelian'], 'BDB')
self.assertEqual(response.json()['statusInvestasi'], 'DJL')
def test_get_investasi_has_field_uang_investasi(self):
investasi = Investasi(investor=self.user, pengadaan=self.pengadaan, nominal=1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment