Commit fa0e7fc7 authored by cj0125's avatar cj0125

Added functional test for recipes_detail. Also added its corresponding html, url, view to test it.

parent c198faef
<html>
<head>
<title>Recipes - Detail</title>
</head>
</html>
\ No newline at end of file
......@@ -17,7 +17,7 @@ Including another URLconf
from django.conf.urls import url
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView
from .views import OrdersCreateFormView, OrdersDetailView, OrdersListView, OrdersUpdateFormView
from .views import RecipesCreateFormView
from .views import RecipesCreateFormView, RecipesDetailView
urlpatterns = [
url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'),
......@@ -29,5 +29,6 @@ urlpatterns = [
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'),
url(r'^recipes_detail$',RecipesDetailView.as_view(),name='RD'),
]
......@@ -36,6 +36,10 @@ class RecipesCreateFormView(CreateView):
model = None
template_name = 'recipes_create_form.html'
class RecipesDetailView(DetailView):
model = None
......
......@@ -58,6 +58,11 @@ class NewVisitorTest(unittest.TestCase):
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)
def test_display_RD(self):
self.browser.get('http://localhost:8000/recipes_detail')
self.assertIn('Recipes - Detail', self.browser.title)
self.assertIn('http://localhost:8000/recipes_detail', 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