From 3393acda5549550d5004649675990a69556c0309 Mon Sep 17 00:00:00 2001 From: Shiftypanda Date: Wed, 14 Feb 2018 23:37:09 +0000 Subject: [PATCH] Add SRI and updated paths --- functional_tests/tests.py | 28 ++++++++++++++++++++++++---- sensibdiary/settings.py | 1 + sensibdiary/urls.py | 2 +- sleep/static/templates/css/sleep.css | 10 ++++++++++ sleep/templates/sleep/base.html | 4 ++-- sleep/templates/sleep/index.html | 20 +++++++++++++------- 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/functional_tests/tests.py b/functional_tests/tests.py index 66352fa..78693bb 100644 --- a/functional_tests/tests.py +++ b/functional_tests/tests.py @@ -1,5 +1,7 @@ +from django.test import LiveServerTestCase from selenium import webdriver from selenium.webdriver.common.keys import Keys + import time import unittest @@ -19,14 +21,32 @@ def test_can_record_a_sleep_and_retrieve_it_later(self): self.browser.get(self.live_server_url) - # She notices the page title and header mention sleep diary - + # She notices the page title and header mention SenSibDiary + self.assertIn('SenSibDiary', self.browser.title) + header_text = self.browser.find_element_by_tag_name('h1').text + self.assertIn('SenSibDiary', header_text) # She is told straight away more about the sleep diary + # She decides that she does want to enter some details and # She is invited to enter her login details or register - # She registers for her username "Kirsty" and enters a password "Password1" - # After confirmed login she is then redirected to enter a sleep diary + # She registers for her username "Kirsty" + # and enters a password "Password1". + + + # After confirmed login she is then redirected to the sleep diary + # This shows a list of all recent sleeps + + # There is also an option to view more detail about a sleep + + # She creates a named sleepers details + + # She enters a sleep diary for today's date + + # The page refreshes and it prompts to enter time started getting ready + # for bed, time in bed and time went to sleep + + self.assertIs(False, "Finish test") diff --git a/sensibdiary/settings.py b/sensibdiary/settings.py index 38a5d79..5381333 100644 --- a/sensibdiary/settings.py +++ b/sensibdiary/settings.py @@ -41,6 +41,7 @@ 'intervention', 'behaviour', 'sleep', + 'functional_tests' ] MIDDLEWARE = [ diff --git a/sensibdiary/urls.py b/sensibdiary/urls.py index 82e1e86..20ac60c 100644 --- a/sensibdiary/urls.py +++ b/sensibdiary/urls.py @@ -18,5 +18,5 @@ urlpatterns = [ path('admin/', admin.site.urls), - path('sleep-diary/', include('sleep.urls')), + path('', include('sleep.urls')), ] diff --git a/sleep/static/templates/css/sleep.css b/sleep/static/templates/css/sleep.css index e720457..bcfaedc 100644 --- a/sleep/static/templates/css/sleep.css +++ b/sleep/static/templates/css/sleep.css @@ -72,3 +72,13 @@ body { padding-left: 30px; } + +.table-header { + background-color: teal; + padding-bottom: 50px; + color: white; +} + +.table-first-col { + padding: 20px 10px 20px 10px; +} diff --git a/sleep/templates/sleep/base.html b/sleep/templates/sleep/base.html index 8d3b7b3..10a84f6 100644 --- a/sleep/templates/sleep/base.html +++ b/sleep/templates/sleep/base.html @@ -3,8 +3,8 @@ SenSibDiary - - + + diff --git a/sleep/templates/sleep/index.html b/sleep/templates/sleep/index.html index fe2448c..874248c 100644 --- a/sleep/templates/sleep/index.html +++ b/sleep/templates/sleep/index.html @@ -1,10 +1,16 @@ {% extends 'sleep/base.html' %} {% block content %} - {% for sleep in latest_sleeps_lists %} - -

Sleep date: {{ sleep.sleep_date|date:'d-m-Y'}}

-
- - {% endfor %} - +

Sleep Diary entries

+ + + + + + {% for sleep in latest_sleeps_list %} + + + + + {% endfor %} +
Date Total time asleep
{{ sleep.sleep_date|date:'d-m-Y'}} {{ sleep.total_time_asleep }}
{% endblock %}