summaryrefslogtreecommitdiff
path: root/workshop_app
diff options
context:
space:
mode:
authorAkshen2017-08-02 11:47:11 +0530
committerAkshen2017-08-02 11:47:11 +0530
commit313bfcf6b4960c8224e282abdb7f8bce0d3469b1 (patch)
tree43843dd2690577bc54aa5cbeb53900b4ef82881f /workshop_app
parent0e819d1bd1d92df29ad5c0ecc3610103d945bfae (diff)
downloadworkshop_booking-313bfcf6b4960c8224e282abdb7f8bce0d3469b1.tar.gz
workshop_booking-313bfcf6b4960c8224e282abdb7f8bce0d3469b1.tar.bz2
workshop_booking-313bfcf6b4960c8224e282abdb7f8bce0d3469b1.zip
Updates TestCases
Diffstat (limited to 'workshop_app')
-rw-r--r--workshop_app/tests/test_models.py26
-rw-r--r--workshop_app/tests/test_views.py28
2 files changed, 51 insertions, 3 deletions
diff --git a/workshop_app/tests/test_models.py b/workshop_app/tests/test_models.py
index bd037ec..cbffcfe 100644
--- a/workshop_app/tests/test_models.py
+++ b/workshop_app/tests/test_models.py
@@ -1,7 +1,8 @@
from django.test import TestCase
from workshop_app.models import (
- Profile, User, Workshop, WorkshopType,
- RequestedWorkshop, BookedWorkshop, ProposeWorkshopDate
+ Profile, User, Workshop, WorkshopType,
+ RequestedWorkshop, BookedWorkshop, ProposeWorkshopDate,
+ Testimonial
)
from datetime import datetime
@@ -187,3 +188,24 @@ class BookedWorkshopModelTest(TestCase):
self.assertEqual(self.bwr.booked_workshop_requested.requested_workshop_title.workshoptype_name,
'ISCP' )
+class TestimonialModelTest(TestCase):
+ '''
+ This class tests the Testimonial Model
+ '''
+
+ def setUp(self):
+ self.testimonial_one = Testimonial.objects.create(
+ name='ABC XYZ',
+ institute='VIDYA GHAR',
+ department='CS',
+ message='Lorem ipsum dolor sit amet, consectetur \
+ tempor incididunt ut labore et dolore magna aliqua\
+ quis nostrud exercitation ullamco laboris nisi ut \
+ consequat. Duis aute irure dolor in reprehenderit in voluptat\
+ cillum dolore eu fugiat nulla pariatur. Excepteur sint \
+ proident, sunt in culpa qui officia deserunt mollit anim'
+ )
+
+ def test_testimonialsmodel(self):
+ self.assertEqual(self.testimonial_one.name, 'ABC XYZ')
+ self.assertEqual(self.testimonial_one.department, 'CS') \ No newline at end of file
diff --git a/workshop_app/tests/test_views.py b/workshop_app/tests/test_views.py
index b37e416..e9fe8bc 100644
--- a/workshop_app/tests/test_views.py
+++ b/workshop_app/tests/test_views.py
@@ -91,6 +91,21 @@ class TestProfile(TestCase):
self.assertEqual(response.status_code, 200)
# self.assertTemplateUsed(response, 'workshop_app/profile_updated.html')
+ def test_register_page(self):
+ self.client.get('/register/')
+ self.register_response = self.client.post('/register/',
+ data={
+ 'username':'testuser',
+ 'email':'test@user.com',
+ 'password':'ABCD@123*',
+ 'confirm password':'ABCD@123*',
+ 'first name':'testor',
+ 'last name':'user',
+ 'phone number': 1234567890,
+ 'institute':'IIT',
+ 'department':(2)})
+
+ self.assertEqual(self.register_response.status_code,200)
class TestWorkshopCreation(TestCase):
def setUp(self):
@@ -183,7 +198,8 @@ class TestWorkshopCreation(TestCase):
'proposed_workshop_date': '2017-06-06'
})
self.proposed_workshop = ProposeWorkshopDate.objects.get(proposed_workshop_date='2017-06-06')
- self.assertEqual(str(self.proposed_workshop.proposed_workshop_title),'ISCP 1days, 8hours a day')
+ self.assertEqual(str(self.proposed_workshop.proposed_workshop_title),
+ 'ISCP 1days, 8hours a day')
self.client.logout()
@@ -244,3 +260,13 @@ class TestWorkshopDashboard(TestCase):
)
+class TestStaticPages(TestCase):
+
+ def test_testimonials(self): self.client.get('/testimonials/')
+ def test_register(self): self.client.get('/register/')
+ def test_faq(self): self.client.get('/faq/')
+ def test_how_to_participate(self): self.client.get('/how_to_participate/')
+ def test_benefits(self): self.client.get('/benefits/')
+ def test_fileview(self): self.client.get('/file_view/')
+ def test_view_workshoptype_details(self):
+ self.client.get('/view_workshoptype_details/')