Fakultas Ilmu Komputer UI

Commit ad48b1bd authored by Nabila Febri Viola's avatar Nabila Febri Viola
Browse files

[RED] Change acara donor model name

parent 18eab632
......@@ -2,6 +2,7 @@ import datetime
from unittest.mock import patch
from django.test import TestCase
from django.utils import timezone
from django.utils.timezone import localtime
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework_authlib.tokens import AccessToken
......@@ -19,10 +20,13 @@ class AcaraDonorTest(TestCase):
user = UserFactory()
user.save()
acara_donor = AcaraDonorFactory(user=user)
waktu_donor = acara_donor.waktu_donor.strftime("%d/%m/%Y, %H:%M")
waktu_mulai = localtime(acara_donor.waktu_mulai)
waktu_berakhir = localtime(acara_donor.waktu_berakhir)
self.assertTrue(isinstance(acara_donor, AcaraDonor))
self.assertEqual((str(acara_donor.nama_institusi) + ': ' +
str(acara_donor.alamat_lokasi_donor) + ", " + waktu_donor),
self.assertEqual((f"{acara_donor.nama_institusi}: {acara_donor.alamat_lokasi_donor}, \
{waktu_mulai.date()} \
({waktu_mulai.hour:02d}:{waktu_mulai.minute:02d} \
- {waktu_berakhir.hour:02d}:{waktu_berakhir.minute:02d})"),
str(acara_donor))
......@@ -97,7 +101,7 @@ class AcaraDonorFilterTest(TestCase):
self.user.save()
base_time = timezone.localtime(datetime.datetime(2020, 5, 10, 9, 14,
tzinfo=datetime.timezone.utc))
tzinfo=datetime.timezone.utc))
self.acara_donor_today = AcaraDonorFactory(user=self.user,
waktu_donor=base_time + timezone.timedelta(hours=3))
......
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