summaryrefslogtreecommitdiff
path: root/yaksh/live_server_tests/load_test.py
diff options
context:
space:
mode:
authorKing2018-07-13 01:44:00 -0700
committerGitHub2018-07-13 01:44:00 -0700
commitf0f4a882a796319f766ff67cd3f8133a04054dfd (patch)
treea5c8a3ab617107743864f9faacad341d0e74da00 /yaksh/live_server_tests/load_test.py
parent661c9d82bb680e745cc6b498131a0793b954c436 (diff)
parent0af47ee9292132ab472e3e0bbae617d77437ff72 (diff)
downloadonline_test-f0f4a882a796319f766ff67cd3f8133a04054dfd.tar.gz
online_test-f0f4a882a796319f766ff67cd3f8133a04054dfd.tar.bz2
online_test-f0f4a882a796319f766ff67cd3f8133a04054dfd.zip
Merge pull request #480 from ankitjavalkar/toggle-mod
[Role based implementation] Allow moderator to switch between student and moderator roles
Diffstat (limited to 'yaksh/live_server_tests/load_test.py')
-rw-r--r--yaksh/live_server_tests/load_test.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/yaksh/live_server_tests/load_test.py b/yaksh/live_server_tests/load_test.py
index 520bebe..e5ac068 100644
--- a/yaksh/live_server_tests/load_test.py
+++ b/yaksh/live_server_tests/load_test.py
@@ -1,8 +1,10 @@
from threading import Thread
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from django.contrib.auth.models import User, Group, Permission
+from django.contrib.contenttypes.models import ContentType
# Local imports
-from yaksh.models import User, Profile, Course
+from yaksh.models import User, Profile, Course, create_group
from yaksh.code_server import ServerPool
from yaksh import settings
from .selenium_test import SeleniumTest
@@ -26,6 +28,10 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
cls.code_server_thread = t = Thread(target=code_server_pool.run)
t.start()
+ app_label = 'yaksh'
+ group_name = 'moderator'
+ cls.group = create_group(group_name, app_label)
+
cls.demo_student = User.objects.create_user(
username='demo_student',
password='demo_student',
@@ -45,7 +51,8 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
cls.demo_mod_profile = Profile.objects.create(
user=cls.demo_mod,
roll_number=0, institute='IIT',
- department='Chemical', position='Moderator'
+ department='Chemical', position='Moderator',
+ is_moderator=True
)
course_obj = Course()
@@ -61,6 +68,7 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
cls.demo_mod.delete()
cls.demo_mod_profile.delete()
cls.demo_course.delete()
+ cls.group.delete()
cls.code_server_pool.stop()
cls.code_server_thread.join()