Fakultas Ilmu Komputer UI

Commit 79c68b7d authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Merge branch 'development' into 'PBI-12-info_kegiatan'

# Conflicts:
#   informasi_fasilitas/models.py
#   informasi_fasilitas/urls.py
#   informasi_fasilitas/views.py
parents 99952ed6 0aae65a3
Pipeline #81046 failed with stages
in 2 minutes and 22 seconds
...@@ -2,11 +2,11 @@ from django.contrib import admin, messages ...@@ -2,11 +2,11 @@ from django.contrib import admin, messages
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from notification.utils import send_komentar_notification, get_target_fcm_device from notification.utils import send_komentar_notification, get_target_fcm_device
from .models import Lokasi, Fasilitas, Komentar, Kegiatan, KomentarKegiatan, FotoKegiatan from .models import Lokasi, Fasilitas, KomentarFasilitas, Kegiatan, KomentarKegiatan, FotoKegiatan
class KomentarAdmin(admin.ModelAdmin): class KomentarAdmin(admin.ModelAdmin):
list_display = ('__str__', 'deskripsi', 'user', 'notify_to') list_display = ('__str__', 'user', 'created', 'notify_to')
actions = ('send_notification',) actions = ('send_notification',)
def send_notification(self, request, queryset): def send_notification(self, request, queryset):
...@@ -30,7 +30,7 @@ class KomentarAdmin(admin.ModelAdmin): ...@@ -30,7 +30,7 @@ class KomentarAdmin(admin.ModelAdmin):
# Register your models here. # Register your models here.
admin.site.register(Lokasi) admin.site.register(Lokasi)
admin.site.register(Fasilitas) admin.site.register(Fasilitas)
admin.site.register(Komentar, KomentarAdmin) admin.site.register(KomentarFasilitas, KomentarAdmin)
admin.site.register(Kegiatan) admin.site.register(Kegiatan)
admin.site.register(KomentarKegiatan, KomentarAdmin) admin.site.register(KomentarKegiatan, KomentarAdmin)
admin.site.register(FotoKegiatan) admin.site.register(FotoKegiatan)
# Generated by Django 3.1.7 on 2021-05-31 10:03
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('informasi_fasilitas', '0016_kegiatan_links'),
]
operations = [
migrations.RenameModel(
old_name='Komentar',
new_name='KomentarFasilitas',
),
migrations.RenameField(
model_name='komentarfasilitas',
old_name='date_time',
new_name='created',
),
]
# Generated by Django 3.1.7 on 2021-05-31 12:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('informasi_fasilitas', '0017_auto_20210531_1003'),
]
operations = [
migrations.RenameField(
model_name='komentarfasilitas',
old_name='fasilitas',
new_name='informasi',
),
migrations.RenameField(
model_name='komentarkegiatan',
old_name='kegiatan',
new_name='informasi',
),
]
# Generated by Django 3.1.7 on 2021-05-31 12:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('informasi_fasilitas', '0018_auto_20210531_1202'),
('informasi_fasilitas', '0019_auto_20210527_2251'),
]
operations = [
]
# Generated by Django 3.1.7 on 2021-05-31 15:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('informasi_fasilitas', '0020_merge_20210531_1241'),
]
operations = [
migrations.AlterField(
model_name='kegiatan',
name='zona_waktu',
field=models.CharField(choices=[('WIB', 'WIB'), ('WITA', 'WITA'), ('WIT', 'WIT')], default='WIB', max_length=4),
),
]
...@@ -100,14 +100,19 @@ class Kegiatan(models.Model): ...@@ -100,14 +100,19 @@ class Kegiatan(models.Model):
class Komentar(models.Model): class Komentar(models.Model):
objects = models.Manager() objects = models.Manager()
fasilitas = models.ForeignKey(Fasilitas, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE)
date_time = models.DateTimeField(auto_now_add=True)
deskripsi = models.TextField() deskripsi = models.TextField()
created = models.DateTimeField(auto_now_add=True)
class Meta:
abstract = True
def __str__(self): def __str__(self):
return self.deskripsi return self.deskripsi
class KomentarFasilitas(Komentar):
informasi = models.ForeignKey(Fasilitas, on_delete=models.CASCADE)
class Likes(models.Model): class Likes(models.Model):
objects = models.Manager() objects = models.Manager()
user = models.ForeignKey(User, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE)
...@@ -126,15 +131,9 @@ class Dislikes(models.Model): ...@@ -126,15 +131,9 @@ class Dislikes(models.Model):
class Meta: class Meta:
unique_together = ('user', 'fasilitas') unique_together = ('user', 'fasilitas')
class KomentarKegiatan(models.Model): class KomentarKegiatan(Komentar):
objects = models.Manager() informasi = models.ForeignKey(Kegiatan, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
kegiatan = models.ForeignKey(Kegiatan, on_delete=models.CASCADE)
deskripsi = models.TextField()
created = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.deskripsi
class FotoKegiatan(models.Model): class FotoKegiatan(models.Model):
objects = models.Manager() objects = models.Manager()
......
...@@ -113,10 +113,11 @@ class FotoKegiatanSerializer(serializers.ModelSerializer): ...@@ -113,10 +113,11 @@ class FotoKegiatanSerializer(serializers.ModelSerializer):
class KegiatanSerializer(serializers.ModelSerializer): class KegiatanSerializer(serializers.ModelSerializer):
place_id = serializers.CharField(source='lokasi.place_id', read_only=True) place_id = serializers.CharField(source='lokasi.place_id', read_only=True)
creator = serializers.CharField(source='user.last_name', read_only=True) creator = serializers.CharField(source='user.last_name', read_only=True)
creator_email = serializers.CharField(source='user.email', read_only=True)
class Meta: class Meta:
model = Kegiatan model = Kegiatan
fields = ('id', 'place_id', 'creator', 'lokasi', 'user', fields = ('id', 'place_id', 'creator', 'lokasi', 'user', 'creator_email',
'nama_kegiatan', 'penyelenggara', 'deskripsi', 'nama_kegiatan', 'penyelenggara', 'deskripsi',
"links", "nomor_kontak", "nama_kontak", "links", "nomor_kontak", "nama_kontak",
"zona_waktu", 'time_start', 'time_end') "zona_waktu", 'time_start', 'time_end')
...@@ -150,11 +151,14 @@ class KegiatanSerializerRead(KegiatanSerializer): ...@@ -150,11 +151,14 @@ class KegiatanSerializerRead(KegiatanSerializer):
return time.strftime('%Y-%m-%d %H:%M') return time.strftime('%Y-%m-%d %H:%M')
class KomentarKegiatanSerializer(serializers.ModelSerializer): class KomentarKegiatanSerializer(serializers.ModelSerializer):
kegiatan = serializers.IntegerField(source='kegiatan.id', read_only=True) kegiatan = serializers.IntegerField(source='informasi.id', read_only=True)
creator = serializers.CharField(source='user.last_name', read_only=True) creator = serializers.CharField(source='user.last_name', read_only=True)
creator_email = serializers.CharField(source='user.email', read_only=True)
class Meta: class Meta:
model = KomentarKegiatan model = KomentarKegiatan
fields = ('id', 'creator', 'kegiatan', 'deskripsi', 'created') fields = ('id', 'creator', 'kegiatan', 'deskripsi', 'created',
'creator_email')
extra_kwargs = { extra_kwargs = {
'deskripsi': {'required': True}, 'deskripsi': {'required': True},
'created': {'required' : True} 'created': {'required' : True}
......
...@@ -37,7 +37,7 @@ class TestAdmin(TestCase): ...@@ -37,7 +37,7 @@ class TestAdmin(TestCase):
def test_list_display(self): def test_list_display(self):
list_display = self.komentar_admin.get_list_display(request) list_display = self.komentar_admin.get_list_display(request)
self.assertEqual(list_display, ('__str__', 'deskripsi', 'user', self.assertEqual(list_display, ('__str__', 'user', 'created',
'notify_to')) 'notify_to'))
def test_list_actions(self): def test_list_actions(self):
......
...@@ -12,7 +12,7 @@ from django.core.files.base import ContentFile ...@@ -12,7 +12,7 @@ from django.core.files.base import ContentFile
from .models import ( from .models import (
Lokasi, Lokasi,
Fasilitas, Fasilitas,
Komentar, KomentarFasilitas,
KURSI_RODA, KURSI_RODA,
Likes, Likes,
Dislikes, Dislikes,
...@@ -257,10 +257,10 @@ class InformasiFasilitasTest(TestCase): ...@@ -257,10 +257,10 @@ class InformasiFasilitasTest(TestCase):
fasilitas_dict=fasilitas_dict, fasilitas_dict=fasilitas_dict,
) )
return Komentar.objects.create( return KomentarFasilitas.objects.create(
**komentar_dict, **komentar_dict,
user=user, user=user,
fasilitas=fasilitas, informasi=fasilitas,
) )
def create_likes_test( def create_likes_test(
...@@ -364,19 +364,19 @@ class InformasiFasilitasTest(TestCase): ...@@ -364,19 +364,19 @@ class InformasiFasilitasTest(TestCase):
user=None, user=None,
komentar_kegiatan_dict=mock_komentar_kegiatan_test, komentar_kegiatan_dict=mock_komentar_kegiatan_test,
user_dict=mock_user_test, user_dict=mock_user_test,
kegiatan=None informasi=None
): ):
user = self.get_or_create_user_test( user = self.get_or_create_user_test(
user=user, user=user,
user_dict=user_dict, user_dict=user_dict,
) )
if kegiatan is None: if informasi is None:
kegiatan = self.create_kegiatan_test() informasi = self.create_kegiatan_test()
return KomentarKegiatan.objects.create( return KomentarKegiatan.objects.create(
**komentar_kegiatan_dict, **komentar_kegiatan_dict,
kegiatan=kegiatan, informasi=informasi,
user=user user=user
) )
......
from django.db.utils import IntegrityError from django.db.utils import IntegrityError
from .test_base import InformasiFasilitasTest from .test_base import InformasiFasilitasTest
from .models import (Lokasi, Fasilitas, Komentar, Likes, Dislikes, from .models import (Lokasi, Fasilitas, KomentarFasilitas, Likes, Dislikes,
Kegiatan, FotoKegiatan, KomentarKegiatan) Kegiatan, FotoKegiatan, KomentarKegiatan)
...@@ -49,13 +49,13 @@ class InformasiFasilitasModelTest(InformasiFasilitasTest): ...@@ -49,13 +49,13 @@ class InformasiFasilitasModelTest(InformasiFasilitasTest):
def test_models_komentar_not_created(self): def test_models_komentar_not_created(self):
with self.assertRaises(IntegrityError) as ex: with self.assertRaises(IntegrityError) as ex:
obj = Komentar(fasilitas=None) obj = KomentarFasilitas(informasi=None)
obj.save() obj.save()
self.assertEqual(ex.expected, IntegrityError) self.assertEqual(ex.expected, IntegrityError)
def test_models_create_new_komentar(self): def test_models_create_new_komentar(self):
self.create_komentar_test() self.create_komentar_test()
count = Komentar.objects.all().count() count = KomentarFasilitas.objects.all().count()
self.assertNotEqual(count, 0) self.assertNotEqual(count, 0)
def test_models_komentar_str(self): def test_models_komentar_str(self):
......
from unittest.mock import patch
from datetime import timedelta
from http import HTTPStatus
import json import json
import shutil import shutil
import os import os
from datetime import timedelta
from http import HTTPStatus
from django.test import Client from django.test import Client
from django.urls import reverse from django.urls import reverse
from django.test import override_settings from django.test import override_settings
from django.utils import timezone from django.utils import timezone
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.conf import settings from django.conf import settings
from unittest.mock import patch
from .test_base import InformasiFasilitasViewTest from .test_base import InformasiFasilitasViewTest
from .models import Lokasi, Kegiatan, FotoKegiatan from .models import Kegiatan, FotoKegiatan
from pplbackend.utils import response_decode
class KegiatanRelatedViewTest(InformasiFasilitasViewTest): class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
...@@ -120,6 +122,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -120,6 +122,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
expected_json = self.mock_kegiatan_test.copy() expected_json = self.mock_kegiatan_test.copy()
expected_json.update({'creator': 'mock last_name', expected_json.update({'creator': 'mock last_name',
'place_id': 'mock_place_id', 'place_id': 'mock_place_id',
'creator_email': self.mock_user_test['email'],
'time_start': self.kegiatan_time_start, 'time_start': self.kegiatan_time_start,
'time_end': self.kegiatan_time_end}) 'time_end': self.kegiatan_time_end})
self.assertEqual(response.status_code, HTTPStatus.CREATED) self.assertEqual(response.status_code, HTTPStatus.CREATED)
...@@ -155,6 +158,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -155,6 +158,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': self.kegiatan.id, 'id': self.kegiatan.id,
'place_id': self.kegiatan.lokasi.place_id, 'place_id': self.kegiatan.lokasi.place_id,
'creator': self.kegiatan.user.last_name, 'creator': self.kegiatan.user.last_name,
'creator_email': self.kegiatan.user.email,
'nama_kegiatan': self.kegiatan.nama_kegiatan, 'nama_kegiatan': self.kegiatan.nama_kegiatan,
'penyelenggara': self.kegiatan.penyelenggara, 'penyelenggara': self.kegiatan.penyelenggara,
'deskripsi': self.kegiatan.deskripsi, 'deskripsi': self.kegiatan.deskripsi,
...@@ -176,6 +180,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -176,6 +180,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': self.kegiatan.id, 'id': self.kegiatan.id,
'place_id': self.kegiatan.lokasi.place_id, 'place_id': self.kegiatan.lokasi.place_id,
'creator': self.kegiatan.user.last_name, 'creator': self.kegiatan.user.last_name,
'creator_email': self.kegiatan.user.email,
'nama_kegiatan': self.kegiatan.nama_kegiatan, 'nama_kegiatan': self.kegiatan.nama_kegiatan,
'penyelenggara': self.kegiatan.penyelenggara, 'penyelenggara': self.kegiatan.penyelenggara,
'deskripsi': self.kegiatan.deskripsi, 'deskripsi': self.kegiatan.deskripsi,
...@@ -204,6 +209,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -204,6 +209,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': kegiatan_wita.id, 'id': kegiatan_wita.id,
'place_id': kegiatan_wita.lokasi.place_id, 'place_id': kegiatan_wita.lokasi.place_id,
'creator': kegiatan_wita.user.last_name, 'creator': kegiatan_wita.user.last_name,
'creator_email': kegiatan_wita.user.email,
'nama_kegiatan': kegiatan_wita.nama_kegiatan, 'nama_kegiatan': kegiatan_wita.nama_kegiatan,
'penyelenggara': kegiatan_wita.penyelenggara, 'penyelenggara': kegiatan_wita.penyelenggara,
'deskripsi': kegiatan_wita.deskripsi, 'deskripsi': kegiatan_wita.deskripsi,
...@@ -232,6 +238,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -232,6 +238,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': kegiatan_wit.id, 'id': kegiatan_wit.id,
'place_id': kegiatan_wit.lokasi.place_id, 'place_id': kegiatan_wit.lokasi.place_id,
'creator': kegiatan_wit.user.last_name, 'creator': kegiatan_wit.user.last_name,
'creator_email': kegiatan_wit.user.email,
'nama_kegiatan': kegiatan_wit.nama_kegiatan, 'nama_kegiatan': kegiatan_wit.nama_kegiatan,
'penyelenggara': kegiatan_wit.penyelenggara, 'penyelenggara': kegiatan_wit.penyelenggara,
'deskripsi': kegiatan_wit.deskripsi, 'deskripsi': kegiatan_wit.deskripsi,
...@@ -252,6 +259,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -252,6 +259,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': self.kegiatan.id, 'id': self.kegiatan.id,
'place_id': self.kegiatan.lokasi.place_id, 'place_id': self.kegiatan.lokasi.place_id,
'creator': self.kegiatan.user.last_name, 'creator': self.kegiatan.user.last_name,
'creator_email': self.kegiatan.user.email,
'nama_kegiatan': self.kegiatan.nama_kegiatan, 'nama_kegiatan': self.kegiatan.nama_kegiatan,
'penyelenggara': self.kegiatan.penyelenggara, 'penyelenggara': self.kegiatan.penyelenggara,
'deskripsi': self.kegiatan.deskripsi, 'deskripsi': self.kegiatan.deskripsi,
...@@ -283,6 +291,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -283,6 +291,7 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
expected_json = self.mock_kegiatan_test.copy() expected_json = self.mock_kegiatan_test.copy()
expected_json.update({'creator': 'mock last_name', expected_json.update({'creator': 'mock last_name',
'place_id': 'mock_place_id', 'place_id': 'mock_place_id',
'creator_email': self.mock_user_test['email'],
'time_start': self.kegiatan_time_start, 'time_start': self.kegiatan_time_start,
'time_end': self.kegiatan_time_end}) 'time_end': self.kegiatan_time_end})
...@@ -365,7 +374,8 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -365,7 +374,8 @@ class KegiatanRelatedViewTest(InformasiFasilitasViewTest):
'id': self.kegiatan.id, 'id': self.kegiatan.id,
'place_id': self.kegiatan.lokasi.place_id, 'place_id': self.kegiatan.lokasi.place_id,
'creator': self.kegiatan.user.last_name, 'creator': self.kegiatan.user.last_name,
'nama_kegiatan': self.kegiatan.nama_kegiatan, 'creator_email': self.kegiatan.user.email,
'nama_kegiatan' : self.kegiatan.nama_kegiatan,
'penyelenggara': self.kegiatan.penyelenggara, 'penyelenggara': self.kegiatan.penyelenggara,
'deskripsi': self.kegiatan.deskripsi, 'deskripsi': self.kegiatan.deskripsi,
'links': self.kegiatan.links, 'links': self.kegiatan.links,
......
import json
from http import HTTPStatus from http import HTTPStatus
from django.urls import reverse from django.urls import reverse
from pplbackend.utils import response_decode
from .test_base import InformasiFasilitasViewTest from .test_base import InformasiFasilitasViewTest
from .models import Komentar from .models import KomentarFasilitas
from pplbackend.utils import response_decode from pplbackend.utils import response_decode
from .views import TIME_FORMAT from .views import TIME_FORMAT
...@@ -26,7 +26,7 @@ class KomentarRelatedViewTest(InformasiFasilitasViewTest): ...@@ -26,7 +26,7 @@ class KomentarRelatedViewTest(InformasiFasilitasViewTest):
self.client.post(self.add_komentar_url, self.mock_komentar_test) self.client.post(self.add_komentar_url, self.mock_komentar_test)
self.assertEqual(response.status_code, HTTPStatus.CREATED) self.assertEqual(response.status_code, HTTPStatus.CREATED)
count = Komentar.objects.filter(fasilitas=self.fasilitas).count() count = KomentarFasilitas.objects.filter(informasi=self.fasilitas).count()
self.assertEqual(count, 1) self.assertEqual(count, 1)
def test_cannot_comment_facility_if_deskripsi_empty(self): def test_cannot_comment_facility_if_deskripsi_empty(self):
...@@ -48,7 +48,8 @@ class KomentarRelatedViewTest(InformasiFasilitasViewTest): ...@@ -48,7 +48,8 @@ class KomentarRelatedViewTest(InformasiFasilitasViewTest):
'id': komentar.id, 'id': komentar.id,
'deskripsi': komentar.deskripsi, 'deskripsi': komentar.deskripsi,
'creator': komentar.user.last_name, 'creator': komentar.user.last_name,
'date_time': komentar.date_time.strftime(TIME_FORMAT), 'creator_email': komentar.user.email,
'created': komentar.created.strftime(TIME_FORMAT),
} }
} }
self.assertEqual(response_json, expected_json) self.assertEqual(response_json, expected_json)
...@@ -29,7 +29,7 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -29,7 +29,7 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest):
self.client.post(self.add_komentar_kegiatan_url, self.mock_komentar_kegiatan_test) self.client.post(self.add_komentar_kegiatan_url, self.mock_komentar_kegiatan_test)
self.assertEqual(response.status_code, HTTPStatus.CREATED) self.assertEqual(response.status_code, HTTPStatus.CREATED)
count = KomentarKegiatan.objects.filter(kegiatan=self.kegiatan).count() count = KomentarKegiatan.objects.filter(informasi=self.kegiatan).count()
self.assertEqual(count, 1) self.assertEqual(count, 1)
def test_fail_add_komentar_kegiatan(self): def test_fail_add_komentar_kegiatan(self):
...@@ -38,18 +38,18 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -38,18 +38,18 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest):
self.client.post(self.add_komentar_kegiatan_url, None) self.client.post(self.add_komentar_kegiatan_url, None)
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND) self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
count = KomentarKegiatan.objects.filter(kegiatan=self.kegiatan).count() count = KomentarKegiatan.objects.filter(informasi=self.kegiatan).count()
self.assertEqual(count, 0) self.assertEqual(count, 0)
def test_can_get_list_komentar_kegiatan(self): def test_can_get_list_komentar_kegiatan(self):
komentar = self.create_komentar_kegiatan_test(user=self.user, kegiatan=self.kegiatan) komentar = self.create_komentar_kegiatan_test(user=self.user, informasi=self.kegiatan)
response = self.client.get(self.list_komentar_kegiatan_url) response = self.client.get(self.list_komentar_kegiatan_url)
self.assertEqual(response.status_code, HTTPStatus.OK) self.assertEqual(response.status_code, HTTPStatus.OK)
response_json = response_decode(response) response_json = response_decode(response)
expected_id = komentar.id expected_id = komentar.id
expected_creator = komentar.user.last_name expected_creator = komentar.user.last_name
expected_kegiatan = komentar.kegiatan.id expected_kegiatan = komentar.informasi.id
expected_deskripsi = komentar.deskripsi expected_deskripsi = komentar.deskripsi
self.assertEqual(response_json[str(komentar.id)]['id'], expected_id) self.assertEqual(response_json[str(komentar.id)]['id'], expected_id)
...@@ -59,7 +59,7 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest): ...@@ -59,7 +59,7 @@ class KomentarKegiatanRelatedViewTest(InformasiFasilitasViewTest):
self.assertEqual(True, ('created' in response_json[str(komentar.id)].keys())) self.assertEqual(True, ('created' in response_json[str(komentar.id)].keys()))
def test_can_get_komentar_kegiatan(self): def test_can_get_komentar_kegiatan(self):
komentar = self.create_komentar_kegiatan_test(user=self.user, kegiatan=self.kegiatan) komentar = self.create_komentar_kegiatan_test(user=self.user, informasi=self.kegiatan)
kwargs_get_komentar_kegiatan = { kwargs_get_komentar_kegiatan = {