Skip to content

Commit

Permalink
added user stories and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdk6jd committed Oct 7, 2016
1 parent 1f82c6e commit 72ac996
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ models: # PORT 8002
- ./models/:/app
ports:
- "8002:8000"
command: bash -c "pip install faker --upgrade && python manage.py makemigrations && python manage.py migrate && pip install --upgrade requests && pip install --upgrade urllib3 && python manage.py loaddata db.json && mod_wsgi-express start-server --reload-on-changes ./models/wsgi.py"
command: bash -c "pip install faker --upgrade && python manage.py makemigrations && python manage.py migrate && pip install --upgrade requests && pip install --upgrade urllib3 && pip install arrow --upgrade && python manage.py loaddata db.json && mod_wsgi-express start-server --reload-on-changes ./models/wsgi.py"

exp: # PORT 8001
image: tp33/django
Expand Down
8 changes: 7 additions & 1 deletion models/daasapp/tests/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import datetime
import random
import arrow

#create new class
#fields = ['username', 'password', 'email_address','date_joined','is_active','f_name','l_name', 'bio']
Expand Down Expand Up @@ -49,7 +50,12 @@ def test1_user_attributes(self):
print("test_user_attributes GET " + str(resp))
self.assertEquals(resp["ok"],True)
self.assertEquals(resp['resp']['f_name'], 'Mark')

# Unit Test for User Story 4
self.assertEquals(resp['resp']['bio'], "a zoonal")
# Unit Test for User Story 5
t = arrow.get(resp['resp']['date_joined'])
self.assertLess(t.naive, datetime.datetime.now())

def test2_fails_invalid_user(self):
response = self.client.get(reverse('inspect_user', kwargs=None))
self.assertEquals(response.status_code, 200)
Expand Down
15 changes: 9 additions & 6 deletions web/daasapp/templates/web/lets-grade.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ <h3 class="list-group-item-heading">User Stories</h3>
<p> 3. As a user, I would like to get information on a drone. </p>
<p> 4. As a user, I would like to have a biography section to express myself. </p>
<p> 5. As a user, I would like to show people how long I've been on the site. </p>
<p> 6. As a user, I would like to see a list of drones I am currently loaning out. </p>
<p> 6. As a user, I would like to see the three most recent drones available. </p>
</p>
</li>

<li class="list-group-item list-group-item-warning">
<h3 class="list-group-item-heading">Unit Tests</h3>
<p class="list-group-item-text">
Donec id elitnon mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elitnon mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elitnon mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elitnon mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elitnon mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
<p> 1. <a href = "https://github.com/samuelhavron/daas/blob/master/models/daasapp/tests/test_users.py#L13-L23"> See code that creates user profile using UserForm. </a> </p>
<p> 2. <a href = "https://github.com/samuelhavron/daas/blob/master/models/daasapp/tests/test_users.py#L26-L65"> See code that inspects users and gets user attributes. </a> </p>
<p> 3. <a href = "https://github.com/samuelhavron/daas/blob/master/models/daasapp/tests/test_drones.py#L10-L52"> See code that creates drones, gets drone attributes and tests invalid drone ids. </a> </p>
<p> 4. <a href = "" > See code that inspects biography. </a> </p>
<p> 5. <a href = "" > See code that inspects when the user signed up. </a> </p>



</p>
</li>

Expand Down

0 comments on commit 72ac996

Please sign in to comment.