Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msinovcic committed May 18, 2015
1 parent 83a84fe commit bd1734b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions oneplus/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ def create_learner(self, school, **kwargs):
return Learner.objects.create(school=school, **kwargs)

def create_participant(self, learner, classs, **kwargs):
try:
participant = Participant.objects.get(learner=learner)
except Participant.DoesNotExist:
participant = Participant.objects.create(
learner=learner, classs=classs, **kwargs)
participant = Participant.objects.create(
learner=learner, classs=classs, **kwargs)

return participant

Expand Down Expand Up @@ -1311,6 +1308,17 @@ def test_login(self):

self.assertContains(resp, "WELCOME")

self.create_participant(
learner,
self.classs,
datejoined=datetime.now())

resp = c.post(reverse('auth.login'), data={
'username': "+27231231231",
'password': '1234'},
follow=True)
self.assertContains(resp, "Account Issue")

def test_points_screen(self):
self.client.get(reverse(
'auth.autologin',
Expand Down

0 comments on commit bd1734b

Please sign in to comment.