Fakultas Ilmu Komputer UI

Commit bc1242f3 authored by Kevin Albert Simanjuntak's avatar Kevin Albert Simanjuntak
Browse files

First unit test and url mapping, dummy view

parent ead16600
from django.urls import resolve
from django.test import TestCase
from lists.views import home_page
class SmokeTest(TestCase):
class HomePageTest(TestCase):
def test_bad_maths(self):
self.assertEqual(1 + 1, 3)
\ No newline at end of file
def test_root_url_resolves_to_home_page_view(self):
found = resolve('/')
self.assertEqual(found.func, home_page)
\ No newline at end of file
from django.shortcuts import render
# Create your views here.
def home_page():
pass
\ No newline at end of file
"""superlists URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from lists import views
urlpatterns = [
path('admin/', admin.site.urls),
]
url(r'^$', views.home_page, name='home'),
]
\ No newline at end of file
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