Commit e33b0f7c authored by cj0125's avatar cj0125

Added functional test for orders_update_form. Also added its corresponding...

Added functional test for orders_update_form. Also added its corresponding html, url, and view to test it.
parent 7e4c234f
<html>
<head>
<title>Orders - Update Form</title>
</head>
</html>
\ No newline at end of file
...@@ -15,7 +15,7 @@ Including another URLconf ...@@ -15,7 +15,7 @@ Including another URLconf
""" """
from django.conf.urls import url from django.conf.urls import url
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView, OrdersCreateFormView, OrdersDetailView, OrdersListView from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView, OrdersCreateFormView, OrdersDetailView, OrdersListView, OrdersUpdateFormView
urlpatterns = [ urlpatterns = [
url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'), url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'),
...@@ -25,5 +25,6 @@ urlpatterns = [ ...@@ -25,5 +25,6 @@ urlpatterns = [
url(r'^orders_create_form$',OrdersCreateFormView.as_view(),name='OCF'), url(r'^orders_create_form$',OrdersCreateFormView.as_view(),name='OCF'),
url(r'^orders_detail$',OrdersDetailView.as_view(),name='OD'), url(r'^orders_detail$',OrdersDetailView.as_view(),name='OD'),
url(r'^orders_list$',OrdersListView.as_view(),name='OL'), url(r'^orders_list$',OrdersListView.as_view(),name='OL'),
url(r'^orders_update_form$',OrdersUpdateFormView.as_view(),name='OUF'),
] ]
...@@ -28,5 +28,10 @@ class OrdersDetailView(DetailView): ...@@ -28,5 +28,10 @@ class OrdersDetailView(DetailView):
class OrdersListView(ListView): class OrdersListView(ListView):
model = None model = None
class OrdersUpdateFormView(UpdateView):
model = None
template_name = 'orders_update_form.html'
...@@ -47,7 +47,12 @@ class NewVisitorTest(unittest.TestCase): ...@@ -47,7 +47,12 @@ class NewVisitorTest(unittest.TestCase):
def test_display_OL(self): def test_display_OL(self):
self.browser.get('http://localhost:8000/orders_list') self.browser.get('http://localhost:8000/orders_list')
self.assertIn('Orders - List', self.browser.title) self.assertIn('Orders - List', self.browser.title)
self.assertIn('http://localhost:8000/orders_list', self.browser.current_url) self.assertIn('http://localhost:8000/orders_list', self.browser.current_url)
def test_display_OUF(self):
self.browser.get('http://localhost:8000/orders_update_form')
self.assertIn('Orders - Update Form', self.browser.title)
self.assertIn('http://localhost:8000/orders_update_form', self.browser.current_url)
self.fail('Finish the test!') self.fail('Finish the test!')
if __name__ == '__main__': if __name__ == '__main__':
......
This diff is collapsed.
Markdown is supported
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