Commit b99bddc0 authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added the orders update form page

parent 8818b2c3
......@@ -59,4 +59,4 @@ class OrdersDetailPageTest(TestCase):
class OrdersUpdatePageTest(TestCase):
def test_orders_update_page_returns_correct_html(self):
response = self.client.get('/orders-update')
self.assertTemplateUsed(response, 'orders_update.html')
self.assertTemplateUsed(response, 'orders_update_form.html')
......@@ -14,6 +14,7 @@ from .views import RecipesCreateView
from .views import OrdersListView
from .views import OrdersDetailView
from .views import OrdersUpdateView
urlpatterns = [
path('', HomePageView.as_view()),
......@@ -26,5 +27,6 @@ urlpatterns = [
path('recipes-update', RecipesUpdateView.as_view()),
path('recipes-create', RecipesCreateView.as_view()),
path('orders-list', OrdersListView.as_view()),
path('orders-detail', OrdersDetailView.as_view())
path('orders-detail', OrdersDetailView.as_view()),
path('orders-update', OrdersUpdateView.as_view())
]
......@@ -32,3 +32,6 @@ class OrdersListView(TemplateView):
class OrdersDetailView(TemplateView):
template_name = "orders_detail.html"
class OrdersUpdateView(TemplateView):
template_name = "orders_update_form.html"
......@@ -306,7 +306,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_orders_detail_from_update.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/orders-list",
"http://localhost:8000/orders-detail",
self.browser.current_url
)
......
......@@ -31,7 +31,7 @@
</div>
<div>
<form>
<form method="get" action="http://localhost:8000/orders-update">
<button type="submit" id="button_to_orders_update">Update Fields</button>
</form>
</div>
......
<!DOCTYPE html>
<html>
<head>
<title>Orders - Update</title>
</head>
<body>
<div>
<h1 id="page_header">Orders - Update</h1>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>Field</th>
<th>Current Value</th>
<th>New Value</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Customer</td>
<td></td>
<form>
<td>
<input type="text">
</td>
<td>
<button type="submit">Save Changes</button>
</td>
</form>
</tr>
<tr>
<td>Size</td>
<td></td>
<form>
<td>
<input type="text">
</td>
<td>
<button type="submit">Save Changes</button>
</td>
</form>
</tr>
<tr>
<td>Base Recipe</td>
<td></td>
<form>
<td>
<input type="text">
</td>
<td>
<button type="submit">Save Changes</button>
</td>
</form>
</tr>
<tr>
<td>Customization</td>
<td></td>
<form>
<td>
<input type="text">
</td>
<td>
<button type="submit">Save Changes</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
<div>
<form method="get" action="http://localhost:8000/orders-detail">
<button type="submit" id="back_button">Back to Detail</button>
</form>
</div>
</body>
</html>
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