Commit f5f65351 authored by cj0125's avatar cj0125

Added functional test to ingredients_update_form. Also added its corresponding...

Added functional test to ingredients_update_form. Also added its corresponding html, url, and views to test it.
parent b8110b0a
<html>
<head>
<title>Ingredients - Update Form</title>
</head>
</html>
\ No newline at end of file
......@@ -15,11 +15,12 @@ Including another URLconf
"""
from django.conf.urls import url
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView
from .views import IngredientsCreateFormView, IngredientsDetailView, IngredientsListView, IngredientsUpdateFormView
urlpatterns = [
url(r'^ingredients_create_form$',IngredientsCreateFormView.as_view(),name='ICF'),
url(r'^ingredients_detail$',IngredientsDetailView.as_view(),name='ID'),
url(r'^ingredients_list$', IngredientsListView.as_view(), name='IL'),
url(r'^ingredients_update_form$',IngredientsUpdateFormView.as_view(),name='IUF'),
]
......@@ -13,3 +13,8 @@ class IngredientsDetailView(DetailView):
class IngredientsListView(ListView):
model = None
class IngredientsUpdateFormView(UpdateView):
model = None
template_name = 'ingredients_update_form.html'
......@@ -30,6 +30,11 @@ class NewVisitorTest(unittest.TestCase):
self.assertIn('http://localhost:8000/ingredients_list', self.browser.current_url)
self.fail('Finish the test!')
def test_display_IUF(self):
self.browser.get('http://localhost:8000/ingredients_update_form')
self.assertIn('Ingredients - Update Form', self.browser.title)
self.assertIn('http://localhost:8000/ingredients_update_form', self.browser.current_url)
if __name__ == '__main__':
unittest.main(warnings = 'ignore')
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