Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update urls and add test cases #6

Open
wants to merge 1 commit into
base: single_page
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions oxfordpython/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.test import Client
from django.test import TestCase

class UrlRouteTests(TestCase):

def setup(self):
self.client = Client()

def test_home_page_is_accessible(self):
# tests that '' response is 200
response = self.client.get('')
self.assertIs(response.status_code, 200)

def test_admin_page_is_accessible(self):
# tests that 'admin/' response is 200
response = self.client.get('admin/')
self.assertIs(response.status_code, 200)
6 changes: 3 additions & 3 deletions oxfordpython/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.conf.urls import url
from django.urls import path
from django.contrib import admin

from .main import views as main_views

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', main_views.HomeView.as_view(), name='home'),
path('admin/', admin.site.urls),
path('', main_views.HomeView.as_view(), name='home'),
]