Fakultas Ilmu Komputer UI

Commit f004a532 authored by Bimo Iman Smartadi's avatar Bimo Iman Smartadi
Browse files

[REFACTOR] Edited to self. variable

parent 8f9dfd50
......@@ -7,13 +7,13 @@ import tempfile
# Create your tests here.
class InformasiFasilitasTest(TestCase):
not_null_constraint_failed = 'NOT NULL constraint failed'
not_null_constraint_failed_message = 'NOT NULL constraint failed'
def test_models_lokasi_not_created(self):
with self.assertRaises(IntegrityError) as cm:
obj = Lokasi(name=None)
obj.save();
self.assertTrue(str(cm.exception).startswith(not_null_constraint_failed))
self.assertTrue(str(cm.exception).startswith(self.not_null_constraint_failed_message))
def test_models_create_new_lokasi(self):
image = tempfile.NamedTemporaryFile(suffix=".jpg").name
......@@ -32,7 +32,7 @@ class InformasiFasilitasTest(TestCase):
with self.assertRaises(IntegrityError) as cm:
obj = Fasilitas(lokasi=None)
obj.save();
self.assertTrue(str(cm.exception).startswith(not_null_constraint_failed))
self.assertTrue(str(cm.exception).startswith(self.not_null_constraint_failed_message))
def test_models_create_new_fasilitas(self):
image = tempfile.NamedTemporaryFile(suffix=".jpg").name
......@@ -69,7 +69,7 @@ class InformasiFasilitasTest(TestCase):
with self.assertRaises(IntegrityError) as cm:
obj = Komentar(fasilitas=None)
obj.save();
self.assertTrue(str(cm.exception).startswith(not_null_constraint_failed))
self.assertTrue(str(cm.exception).startswith(self.not_null_constraint_failed_message))
def test_models_create_new_komentar(self):
image = tempfile.NamedTemporaryFile(suffix=".jpg").name
......
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