Skip to content
Snippets Groups Projects
Commit 70612308 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Flying team addition test

parent 29a0e6a2
No related branches found
No related tags found
1 merge request!118Resolve "Flying team location management site"
Pipeline #
......@@ -5,6 +5,11 @@ from web.tests import LoggedInTestCase
class FlyingTeamTests(LoggedInTestCase):
def generate_more_or_less_random_name():
import random
letters = [chr(x) for x in range(97,122)]
return 'Radom' + ''.join(random.choice(letters) for x in range(15))
def test_flyingteam_requests(self):
pages = [
'web.views.equipment_and_rooms.flying_teams',
......@@ -14,3 +19,15 @@ class FlyingTeamTests(LoggedInTestCase):
for page in pages:
response = self.client.get(reverse(page))
self.assertEqual(response.status_code, 200)
def test_flyingteam_add(self):
page = reverse('web.views.equipment_and_rooms.flying_teams_add')
data = {
'id_place': self.generate_more_or_less_random_name()
}
response = self.client.post(page, data)
self.assertEqual(response.status_code, 200)
freshly_created = FlyingTeam.objects.filter(place=data['id_place'])
self.assertEqual(len(freshly_created), 1)
freshly_created.delete()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment