Commit c198faef authored by cj0125's avatar cj0125

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

Added functional test for recipes_create_form. Also added its corresponding html, url, views to test it.
parent e33b0f7c
<html>
<head>
<title>Recipes - Create Form</title>
</head>
</html>
\ No newline at end of file
......@@ -15,7 +15,9 @@ Including another URLconf
"""
from django.conf.urls import url
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView, OrdersCreateFormView, OrdersDetailView, OrdersListView, OrdersUpdateFormView
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView
from .views import OrdersCreateFormView, OrdersDetailView, OrdersListView, OrdersUpdateFormView
from .views import RecipesCreateFormView
urlpatterns = [
url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'),
......@@ -26,5 +28,6 @@ urlpatterns = [
url(r'^orders_detail$',OrdersDetailView.as_view(),name='OD'),
url(r'^orders_list$',OrdersListView.as_view(),name='OL'),
url(r'^orders_update_form$',OrdersUpdateFormView.as_view(),name='OUF'),
url(r'^recipes_create_form$',RecipesCreateFormView.as_view(),name='RCF'),
]
......@@ -32,6 +32,12 @@ class OrdersUpdateFormView(UpdateView):
model = None
template_name = 'orders_update_form.html'
class RecipesCreateFormView(CreateView):
model = None
template_name = 'recipes_create_form.html'
......@@ -53,6 +53,11 @@ class NewVisitorTest(unittest.TestCase):
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)
def test_display_RCF(self):
self.browser.get('http://localhost:8000/recipes_create_form')
self.assertIn('Recipes - Create Form', self.browser.title)
self.assertIn('http://localhost:8000/recipes_create_form', self.browser.current_url)
self.fail('Finish the test!')
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