diff --git a/rowers/tests/test_plans.py b/rowers/tests/test_plans.py index d8a804b1..e6c93f0a 100644 --- a/rowers/tests/test_plans.py +++ b/rowers/tests/test_plans.py @@ -1310,9 +1310,38 @@ class PlannedSessionsView(TestCase): login = self.c.login(username=self.u.username, password=self.password) self.assertTrue(login) - url = '/sessions/teamcreate/' + url = '/rowers/sessions/teamcreate/' response = self.c.get(url) + self.assertEqual(response.status_code,200) + + form_data = { + 'team':[1], + 'startdate': self.w1.startdatetime.date(), + 'enddate': (self.w1.startdatetime+datetime.timedelta(days=5)).date(), + 'preferreddate': self.w1.startdatetime.date(), + 'name': faker.word(), + 'sessiontype': 'session', + 'sessionmode': 'distance', + 'criterium': 'none', + 'sessionvalue': 13000, + 'sessionunit': 'm', + 'course': None, + 'comment':faker.text() + } + + plannedsessionform = PlannedSessionForm(form_data) + + self.assertTrue(plannedsessionform.is_valid()) + + teamform = PlannedSessionTeamForm(self.u,form_data) + + self.assertTrue(teamform.is_valid()) + + response = self.c.post(url,form_data,follow=True) + self.assertEqual(response.status_code,200) + + def test_teamedit_view(self): login = self.c.login(username=self.u.username, password=self.password) self.assertTrue(login) diff --git a/rowers/tests/test_urls.py b/rowers/tests/test_urls.py index f3fc11f9..f0f2596d 100644 --- a/rowers/tests/test_urls.py +++ b/rowers/tests/test_urls.py @@ -262,10 +262,11 @@ class URLTests(TestCase): self.assertTrue(login) response = self.c.get(url,follow=True) if response.status_code != expected: - print url - print response.status_code + print(url ) + print(response.status_code) + self.assertEqual(response.status_code, - expected) + expected) html = BeautifulSoup(response.content,'html.parser') urls = [a['href'] for a in html.find_all('a')] @@ -274,10 +275,10 @@ class URLTests(TestCase): if u not in tested and 'rowers' in u and 'http' not in u and 'authorize' not in u and 'import' not in u and 'logout' not in u: response = self.c.get(u) if response.status_code not in [200,302]: - print len(tested) - print url - print u - print response.status_code + print(len(tested)) + print(url) + print(u) + print(response.status_code) tested.append(u) self.assertIn(response.status_code, [200,302]) diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index 85862f10..d8f693ae 100644 Binary files a/rowers/tests/testdata/testdata.csv.gz and b/rowers/tests/testdata/testdata.csv.gz differ