Fakultas Ilmu Komputer UI

Commit c55ec848 authored by Muhammad Azhar Hassanuddin's avatar Muhammad Azhar Hassanuddin
Browse files

test: saat update toko tidak increment nomor toko terhadap diri sendiri

parent 2429e226
......@@ -256,6 +256,31 @@ class TokoTest(TokoBaseTestCase):
)
self.assertEqual(self.get_string_identifier(toko2), response.json()['identifierToko'])
def test_saat_update_toko_tidak_increment_nomor_toko_terhadap_diri_sendiri(self):
toko2 = Toko.objects.create(
daerah="Pekalongan",
deskripsi_toko='Desk',
latitude=12.001212,
lokasi_toko="Sebelah rumah masyarakat berbahagia",
longitude=13.0,
nama_cabang="2",
nama_toko="Dirgan",
nomor_telepon="0824665341",
owner=self.user,
tipe_usaha="Kelontong",
foto_profil_toko=self.dummy_image
)
toko2_nomor = toko2.nomor_toko
token = self._get_token()
response = self.client.put(
'/api/toko/{}'.format(toko2.pk),
{**self.toko_data, 'nama_cabang': '3'},
content_type="application/json",
HTTP_AUTHORIZATION="JWT {}".format(token))
self.assertEqual(response.json()['nomorToko'], toko2_nomor)
class PengadaanTest(TokoBaseTestCase):
def setUp(self):
super().setUp()
......
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