Fakultas Ilmu Komputer UI

Commit f8c62aad authored by Yumna Pratista's avatar Yumna Pratista
Browse files

first step of ch8

parent feb02269
......@@ -2,9 +2,11 @@
<title>To-Do lists</title>
</head>
<body>
<h1>Start a new To-Do list</h1>
<form method="POST" action="/lists/new">>
<input name="item_text" id="id_new_item" placeholder="Enter a to-do item" />
<h1>Start a new To-Do list</h1>
<form method="POST" action="/lists/new">
<p style="text-align: center;">
<input name="item_text" id="id_new_item" placeholder="Enter a to-do item" />
</p>
{% csrf_token %}
</form>
</form>
</body>
\ No newline at end of file
......@@ -133,7 +133,22 @@ class NewVisitorTest(LiveServerTestCase):
self.assertNotIn('Buy peacock feathers', page_text)
self.assertIn('Buy milk', page_text)
def test_layout_and_styling(self):
# Edith goes to the home page
self.browser.get(self.live_server_url)
self.browser.set_window_size(1024, 768)
# She notices the input box is nicely centered
inputbox = self.browser.find_element_by_id('id_new_item')
inputbox.send_keys('testing')
inputbox.send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('1: testing')
inputbox = self.browser.find_element_by_id('id_new_item')
self.assertAlmostEqual(
inputbox.location['x'] + inputbox.size['width'] / 2,
512,
delta=10)
# if __name__ == '__main__': #
# unittest.main(warnings='ignore') #
\ No newline at end of file
This diff is collapsed.
Supports Markdown
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