Skip to content

Commit

Permalink
Add SRI and updated paths
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftypanda committed Feb 14, 2018
1 parent 3b84417 commit 3393acd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 14 deletions.
28 changes: 24 additions & 4 deletions functional_tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

import time
import unittest

Expand All @@ -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")
1 change: 1 addition & 0 deletions sensibdiary/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'intervention',
'behaviour',
'sleep',
'functional_tests'
]

MIDDLEWARE = [
Expand Down
2 changes: 1 addition & 1 deletion sensibdiary/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

urlpatterns = [
path('admin/', admin.site.urls),
path('sleep-diary/', include('sleep.urls')),
path('', include('sleep.urls')),
]
10 changes: 10 additions & 0 deletions sleep/static/templates/css/sleep.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions sleep/templates/sleep/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<html>
<head>
<title>SenSibDiary</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" integrity="sha384-Ej0hUpn6wbrOTJtRExp8jvboBagaz+Or6E9zzWT+gHCQuuZQQVZUcbmhXQzSG17s" crossorigin="anonymous">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" integrity="sha384-vjTpnzDJYcqNw6YYaRvNDHKSy7YSfQA3/Tqf5q3D6ixmzhjViRH+KTqoQSqIFor1" crossorigin="anonymous">
<link href="//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="{% static 'templates/css/sleep.css' %}">
</head>
Expand Down
20 changes: 13 additions & 7 deletions sleep/templates/sleep/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{% extends 'sleep/base.html' %}
{% block content %}
{% for sleep in latest_sleeps_lists %}

<p class="date">Sleep date: {{ sleep.sleep_date|date:'d-m-Y'}}</p>
<div class="sleep-divider"></div>

{% endfor %}

<h1> Sleep Diary entries </h1>
<table>
<tr class="table-header">
<td> Date </td>
<td> Total time asleep </td>
</tr>
{% for sleep in latest_sleeps_list %}
<tr>
<td class="table-first-col"> {{ sleep.sleep_date|date:'d-m-Y'}}</td>
<td> {{ sleep.total_time_asleep }} </td>
</tr>
{% endfor %}
</table>
{% endblock %}

0 comments on commit 3393acd

Please sign in to comment.