Mercurial > public > sg101
comparison contests/tests/test_views.py @ 796:5977b43499f7
Modified contests to have multiple winners.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 04 Jul 2014 20:30:14 -0500 |
parents | 8789299c75b1 |
children |
comparison
equal
deleted
inserted
replaced
795:5d48fd80f27d | 796:5977b43499f7 |
---|---|
37 slug='test', | 37 slug='test', |
38 description='test', | 38 description='test', |
39 is_public=True, | 39 is_public=True, |
40 creation_date=start, | 40 creation_date=start, |
41 end_date=end, | 41 end_date=end, |
42 winner=user, | 42 win_date=end + datetime.timedelta(days=1), |
43 win_date=end + datetime.timedelta(days=1)) | 43 num_winners=1) |
44 c.save() | 44 c.save() |
45 c.contestants.add(user) | |
46 c.winners.add(user) | |
45 self.contest_id = c.id | 47 self.contest_id = c.id |
46 | 48 |
47 def test_contests(self): | 49 def test_contests(self): |
48 response = self.client.get(reverse('contests-index')) | 50 response = self.client.get(reverse('contests-index')) |
49 self.assertEqual(response.status_code, 200) | 51 self.assertEqual(response.status_code, 200) |
70 c = Contest(title='test', | 72 c = Contest(title='test', |
71 slug='test', | 73 slug='test', |
72 description='test', | 74 description='test', |
73 is_public=True, | 75 is_public=True, |
74 creation_date=start, | 76 creation_date=start, |
75 end_date=end) | 77 end_date=end, |
78 num_winners=1) | |
76 c.save() | 79 c.save() |
77 self.contest_id = c.id | 80 self.contest_id = c.id |
78 | 81 |
79 def test_entry_toggle(self): | 82 def test_entry_toggle(self): |
80 response = self.client.post(reverse('contests-enter'), | 83 response = self.client.post(reverse('contests-enter'), |