summaryrefslogtreecommitdiff
path: root/workshop_app/tests
diff options
context:
space:
mode:
authorAkshen2017-09-14 13:03:05 +0530
committerAkshen2017-09-14 13:03:05 +0530
commit01eafa2acd049473bfb21a4db8793cfacc4d09b7 (patch)
tree6abc534ab9f51a387245a6c2b49da25b3eb64c8e /workshop_app/tests
parentebebc30a5ab8328c2330f0c03302ef7db8715365 (diff)
downloadworkshop_booking-01eafa2acd049473bfb21a4db8793cfacc4d09b7.tar.gz
workshop_booking-01eafa2acd049473bfb21a4db8793cfacc4d09b7.tar.bz2
workshop_booking-01eafa2acd049473bfb21a4db8793cfacc4d09b7.zip
Adds India Map
- Updates model adds state as option - Instructor can view number of workshops state-wise in Map of India - Updates test cases for test_model and test_views - Updates .gitignore - Updates form
Diffstat (limited to 'workshop_app/tests')
-rw-r--r--workshop_app/tests/test_models.py26
-rw-r--r--workshop_app/tests/test_views.py31
2 files changed, 41 insertions, 16 deletions
diff --git a/workshop_app/tests/test_models.py b/workshop_app/tests/test_models.py
index 0b33842..44108ad 100644
--- a/workshop_app/tests/test_models.py
+++ b/workshop_app/tests/test_models.py
@@ -25,11 +25,13 @@ def setUpModule():
email='test.user@gmail.com', password='pass@123')
instructor_profile = Profile.objects.create(user=testUser2, position='instructor',
- department='cs', institute='ace', phone_number='1122334456',
+ department='computer engineering', institute='ace', phone_number='1122334456',
+ title='Doctor', source='Google', location='powai', state='IN-MH',
is_email_verified=1)
coordinator_profile = Profile.objects.create(user=demoUser2, position='coordinator',
- department='IT', institute='iit', phone_number='1122334456',
+ department='IT', institute='iit', phone_number='1122334456',location='powai',
+ title='Doctor', source='Google', state='IN-MH',
is_email_verified=1)
workshoptype1 = WorkshopType.objects.create(workshoptype_name='ISCP',
@@ -73,19 +75,25 @@ class ProfileModelTest(TestCase):
self.testuser1 = User.objects.get(username='testuser1')
self.demouser1 = User.objects.get(username='demouser1')
- self.instructor_profile1 = Profile.objects.create(user=self.testuser1, position='instructor',
- department='cs', institute='ace', phone_number='1123323344558899192',
- is_email_verified=1)
+ self.instructor_profile1 = Profile.objects.create(user=self.testuser1,
+ position='instructor', department='computer engineering',
+ institute='ace', phone_number='1123323344',
+ title='Doctor', source='Google', location='powai', state='IN-MH',
+ is_email_verified=1)
self.coordinator_profile1 = Profile.objects.create(user=self.demouser1, position='coordinator',
- department='IT', institute='iit', phone_number='112233',
- is_email_verified=1)
+ department='IT', institute='iit', phone_number='1122334455',
+ title='Doctor', source='Google', location='powai', state='IN-MH',
+ is_email_verified=1)
def test_profile_model(self):
self.assertEqual(self.demouser1.email,'test.user@gmail.com')
self.assertEqual(self.testuser1.email,'test.user@gmail.com')
self.assertEqual(self.instructor_profile1.position,'instructor')
self.assertEqual(self.coordinator_profile1.position,'coordinator')
+ self.assertEqual(self.coordinator_profile1.location,'powai')
+ self.assertEqual(self.instructor_profile1.location,'powai')
+ self.assertEqual(self.coordinator_profile1.source,'Google')
class WorkshopTypeModelTest(TestCase):
@@ -197,7 +205,7 @@ class TestimonialModelTest(TestCase):
self.testimonial_one = Testimonial.objects.create(
name='ABC XYZ',
institute='VIDYA GHAR',
- department='CS',
+ department='computer engineering',
message='Lorem ipsum dolor sit amet, consectetur \
tempor incididunt ut labore et dolore magna aliqua\
quis nostrud exercitation ullamco laboris nisi ut \
@@ -208,7 +216,7 @@ class TestimonialModelTest(TestCase):
def test_testimonials_model(self):
self.assertEqual(self.testimonial_one.name, 'ABC XYZ')
- self.assertEqual(self.testimonial_one.department, 'CS')
+ self.assertEqual(self.testimonial_one.department, 'computer engineering')
self.assertEqual(self.testimonial_one.institute, 'VIDYA GHAR')
self.assertEqual(self.testimonial_one.message, 'Lorem ipsum dolor sit amet, consectetur \
tempor incididunt ut labore et dolore magna aliqua\
diff --git a/workshop_app/tests/test_views.py b/workshop_app/tests/test_views.py
index 583efd2..ce5e4f2 100644
--- a/workshop_app/tests/test_views.py
+++ b/workshop_app/tests/test_views.py
@@ -32,8 +32,12 @@ class TestProfile(TestCase):
user=self.user2,
department='Computer Engineering',
institute='ace',
+ title='Doctor',
position='instructor',
phone_number='1122993388',
+ location='mumbai',
+ source='Google',
+ state='IN-MH',
is_email_verified=1
)
@@ -104,6 +108,8 @@ class TestProfile(TestCase):
'last name':'user',
'phone number': 1234567890,
'institute':'IIT',
+ 'location':'mumbai',
+ 'state': (2),
'department':(2)})
self.assertEqual(self.register_response.status_code,200)
@@ -129,10 +135,14 @@ class TestWorkshopCreation(TestCase):
self.user_one_profile = Profile.objects.create(
user=self.user_one,
- department='cs',
+ department='computer engineering',
+ title='Doctor',
institute='IIT',
position='instructor',
+ source='Google',
phone_number='1122993388',
+ location='mumbai',
+ state='IN-MH',
is_email_verified=1
)
@@ -152,9 +162,13 @@ class TestWorkshopCreation(TestCase):
self.user_two_profile = Profile.objects.create(
user=self.user_two,
- department='cs',
+ department='computer engineering',
institute='ace',
position='coordinator',
+ title='Mr',
+ source='Google',
+ location='mumbai',
+ state='IN-MH',
phone_number='1122993388',
is_email_verified=1
)
@@ -180,8 +194,8 @@ class TestWorkshopCreation(TestCase):
self.client.login(username=self.user_one, password='pass@123')
self.client.post('/create_workshop/',
{
- 'workshop_title' : (2),
- 'recurrences' : 'RRULE:FREQ=WEEKLY;UNTIL=20170624T183000Z;BYDAY=WE;'
+ 'workshop_title' : self.workshoptype.id,
+ 'recurrences' : 'RRULE:FREQ=WEEKLY;UNTIL=20170924T183000Z;BYDAY=WE;'
})
self.workshop = Workshop.objects.get(workshop_instructor=self.user_one)
self.assertEqual(str(self.workshop.workshop_title), 'ISCP 1days, 8hours a day')
@@ -195,7 +209,7 @@ class TestWorkshopCreation(TestCase):
'condition_one': 1,
'condition_two': 1,
'condition_three': 1,
- 'proposed_workshop_title': (2),
+ 'proposed_workshop_title': self.workshoptype.id,
'proposed_workshop_date': '2017-06-06'
})
self.proposed_workshop = ProposeWorkshopDate.objects.get(proposed_workshop_date='2017-06-06')
@@ -226,6 +240,10 @@ class TestWorkshopDashboard(TestCase):
institute='IIT',
position='instructor',
phone_number='1122993388',
+ source='Google',
+ location='mumbai',
+ state='IN-MH',
+ title='Mr',
is_email_verified=1
)
@@ -339,5 +357,4 @@ class TestWorkshopStats(TestCase):
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.get('Content-Disposition'),'attachment;\
- filename="records_from_2017-01-01_to_2017-12-31.csv"')
-
+ filename="records_from_2017-01-01_to_2017-12-31.csv"') \ No newline at end of file