Fakultas Ilmu Komputer UI

Commit eeb84029 authored by Putu Agastya's avatar Putu Agastya
Browse files

[RED] Additional testting for daftar katalog view

parent 732f61ef
from django.test import TestCase, Client
from django.urls import resolve
from .views import DaftarKatalog
class DaftarKatalogTest(TestCase):
def test_daftar_katalog_url_exist(self):
url = "/"
response = Client().get(f'{url}')
self.assertEqual(response.status_code,200)
\ No newline at end of file
self.assertEqual(response.status_code,200)
def test_daftar_katalog_using_daftar_katalog_template(self):
response = Client().get('/')
self.assertTemplateUsed(response, 'app/daftar_katalog.html')
def test_daftar_katalog_using_daftar_katalog_func(self):
found = resolve('/')
self.assertEqual(found.func.__name__, DaftarKatalog.as_view().__name__)
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader
from django.http import HttpResponse, JsonResponse, HttpResponseRedirect
from django.views.generic import TemplateView
class DaftarKatalog(TemplateView):
pass
def pages(request):
context = {}
......
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