Fakultas Ilmu Komputer UI

Commit 34b22578 authored by Nabila Febri Viola's avatar Nabila Febri Viola
Browse files

[RED] Change acara donor post request

parent e5edaf4a
......@@ -89,14 +89,16 @@ class AcaraDonorSerializerTest(TestCase):
data=self.acara_donor_attr)
self.assertFalse(serializer.is_valid())
@patch('django.utils.timezone.now', return_value=datetime.datetime(
2020, 6, 12, 9, 0, tzinfo=datetime.timezone.utc))
class AcaraDonorCreateViewTest(APITestCase):
""" Test module for Acara Donor API"""
def setUp(self):
self.user = UserFactory()
self.user.save()
self.client.credentials(HTTP_AUTHORIZATION='Bearer ' + str(AccessToken.for_user(self.user)))
self.client.credentials(HTTP_AUTHORIZATION='Bearer ' +
str(AccessToken.for_user(self.user)))
def test_create_acara_donor(self):
response = self.client.post('/acara-donor/pengajuan/',
......@@ -104,15 +106,20 @@ class AcaraDonorCreateViewTest(APITestCase):
"alamat_lokasi_donor": "Sekre Pacil",
"email_kantor": "pacil@cs.ui.ac.id",
"email_koor": "pacilia@gmail.com",
"foto_lokasi": "",
"kategori": "Terbuka",
"kecamatan": "Beji",
"keterangan": "",
"nama_institusi": "Pacilkom",
"nama_koor": "dr. Pacilia",
"no_telp_kantor": "08165342342",
"no_telp_koor": "08167021743",
"nomor": "ea582779-fdfc-444e-ad03-4084e715af0a",
"perkiraan_jumlah_donor": 455,
"waktu_donor": timezone.now() + timezone.timedelta(days=3)},
format='json')
"waktu_berakhir": timezone.now()
+ timezone.timedelta(hours=7),
"waktu_mulai": timezone.now()
+ timezone.timedelta(hours=5)},
format='multipart')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
......
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