deleted redundant assertions from apps.dashboard.tests; removed redundant table code from home.html now that list.html includes it; updated FTs to accomodate the title change to "Dashboard" in home.html
This commit is contained in:
@@ -8,7 +8,6 @@ class HomePageTest(TestCase):
|
||||
|
||||
def test_renders_input_form(self):
|
||||
response = self.client.get('/')
|
||||
self.assertContains(response, '<form method="POST"')
|
||||
self.assertContains(response, '<form method="POST" action="/">')
|
||||
self.assertContains(response, '<input name="item_text"')
|
||||
|
||||
@@ -51,7 +50,6 @@ class DashViewTest(TestCase):
|
||||
|
||||
def test_renders_input_form(self):
|
||||
response = self.client.get('/apps/dashboard/the-only-list-in-the-world/')
|
||||
self.assertContains(response, '<form method="POST"')
|
||||
self.assertContains(response, '<form method="POST" action="/">')
|
||||
self.assertContains(response, '<input name="item_text"')
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ class NewVisitorTest(LiveServerTestCase):
|
||||
def test_can_start_a_todo_list(self):
|
||||
self.browser.get(self.live_server_url)
|
||||
|
||||
self.assertIn("To-Do", self.browser.title)
|
||||
self.assertIn('Dashboard', self.browser.title)
|
||||
header_text = self.browser.find_element(By.TAG_NAME, 'h1').text
|
||||
self.assertIn('To-Do', header_text)
|
||||
self.assertIn('Dashboard', header_text)
|
||||
|
||||
inputbox = self.browser.find_element(By.ID, 'id-new-item')
|
||||
self.assertEqual(inputbox.get_attribute('placeholder'), 'Enter a to-do item')
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>To-Do lists</title>
|
||||
<title>Dashboard</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Your To-Do List</h1>
|
||||
<h1>Dashboard | Start a new to-do list</h1>
|
||||
<form method="POST" action="/">
|
||||
<input name="item_text" id="id-new-item" placeholder="Enter a to-do item">
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
<table id="id-list-table">
|
||||
{% for item in items %}
|
||||
<tr><td>{{ forloop.counter }}. {{ item.text }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user