summaryrefslogtreecommitdiff
path: root/statistics_app/tests
diff options
context:
space:
mode:
authorAkshen2018-02-21 11:06:45 +0530
committerAkshen2018-02-21 11:06:45 +0530
commitca9c06178fd2b3b9b6c8e694ae463ddb250d471e (patch)
treee5a2707b85bc78d82cfc6c5575fa23957f52bf3e /statistics_app/tests
parent1ee7a5f43bb488474e3f5baf8b19e9095e7f104a (diff)
downloadworkshop_booking-ca9c06178fd2b3b9b6c8e694ae463ddb250d471e.tar.gz
workshop_booking-ca9c06178fd2b3b9b6c8e694ae463ddb250d471e.tar.bz2
workshop_booking-ca9c06178fd2b3b9b6c8e694ae463ddb250d471e.zip
Add TestCases for Profile Stats
- Adds test cases for Profile Statistics - Adds columns to Coordinator and Instructor Stats - Increases the number of days for upcoming workshops :
Diffstat (limited to 'statistics_app/tests')
-rw-r--r--statistics_app/tests/test_views.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/statistics_app/tests/test_views.py b/statistics_app/tests/test_views.py
index f3c7927..3d05cc9 100644
--- a/statistics_app/tests/test_views.py
+++ b/statistics_app/tests/test_views.py
@@ -151,6 +151,22 @@ class TestWorkshopStats(TestCase):
self.user_one.user_permissions.add(self.permission[43])
self.user_one.user_permissions.add(self.permission[42])
+ self.user_two = User.objects.create(
+ username='test_user2',
+ email='test.user2@gmail.com')
+
+ self.user_two.set_password('pass@123')
+ self.user_two.save()
+
+ self.user_two_profile = Profile.objects.create(
+ user=self.user_two,
+ department='cs',
+ institute='IIT',
+ position='coordinator',
+ phone_number='1122993388',
+ is_email_verified=1
+ )
+
def test_workshop_stats(self):
settings.SHOW_WORKSHOP_STATS = True
self.client.login(username=self.user_one, password='pass@123')
@@ -174,3 +190,12 @@ class TestWorkshopStats(TestCase):
)
self.assertEqual(response.status_code, 200)
+ def test_profile_stats(self):
+ #Coordinator
+ self.client.login(username=self.user_two, password='pass@123')
+ cresp = self.client.get('/statistics/profile_stats/')
+ self.assertEqual(cresp.templates[0].name, 'workshop_app/logout.html')
+ #Instructor
+ self.client.login(username=self.user_one, password='pass@123')
+ response = self.client.get('/statistics/profile_stats/')
+ self.assertEqual(response.status_code, 200)