summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--yaksh/live_server_tests/__init__.py0
-rw-r--r--yaksh/live_server_tests/load_test.py (renamed from yaksh/tests/load_test.py)33
-rw-r--r--yaksh/live_server_tests/selenium_test.py (renamed from yaksh/tests/selenium_test.py)0
4 files changed, 26 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index b44d4e2..3484d2d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,4 +26,4 @@ before_install:
# command to run tests
script:
- python manage.py test -v 2 yaksh
- - python manage.py test -v 2 yaksh.tests.load_test \ No newline at end of file
+ - python manage.py test -v 2 yaksh.live_server_tests
diff --git a/yaksh/live_server_tests/__init__.py b/yaksh/live_server_tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/yaksh/live_server_tests/__init__.py
diff --git a/yaksh/tests/load_test.py b/yaksh/live_server_tests/load_test.py
index 05fd02f..17934d4 100644
--- a/yaksh/tests/load_test.py
+++ b/yaksh/live_server_tests/load_test.py
@@ -11,13 +11,8 @@ from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from yaksh.models import User, Profile, Question, Quiz, Course, QuestionPaper, TestCase
from selenium_test import SeleniumTest
-from yaksh.code_server import ServerPool #SERVER_POOL_PORT, SERVER_PORTS
+from yaksh.code_server import ServerPool
from yaksh import settings
-# from django.core.management import call_command
-from yaksh.management.commands.create_demo_course import create_demo_course
-
-
-CUR_DIR = os.path.dirname(os.path.abspath(__file__))
class YakshSeleniumTests(StaticLiveServerTestCase):
@@ -37,7 +32,29 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
cls.code_server_thread = t = Thread(target=code_server_pool.run)
t.start()
- demo_course_setup = create_demo_course()
+ demo_student = User.objects.create_user(username='demo_student',
+ password='demo_student',
+ email='demo_student@test.com'
+ )
+ demo_student_profile = Profile.objects.create(user=demo_student,
+ roll_number=3, institute='IIT',
+ department='Chemical', position='Student'
+ )
+
+ demo_mod = User.objects.create_user(username='demo_mod',
+ password='demo_mod',
+ email='demo_mod@test.com'
+ )
+ demo_mod_profile = Profile.objects.create(user=demo_mod,
+ roll_number=0, institute='IIT',
+ department='Chemical', position='Moderator'
+ )
+
+ course_obj = Course()
+ course_obj.create_demo(demo_mod)
+ demo_course = Course.objects.get(id=1)
+
+ demo_course.students.add(demo_student)
@classmethod
def tearDownClass(cls):
@@ -55,6 +72,6 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
def test_load(self):
url = '%s%s' % (self.live_server_url, '/exam/login/')
- quiz_name = "Demo_quiz"
+ quiz_name = "Yaksh Demo quiz"
selenium_test = SeleniumTest(url=url, quiz_name=quiz_name)
selenium_test.run_load_test(url=url, username='demo_student', password='demo_student')
diff --git a/yaksh/tests/selenium_test.py b/yaksh/live_server_tests/selenium_test.py
index 01ccc96..01ccc96 100644
--- a/yaksh/tests/selenium_test.py
+++ b/yaksh/live_server_tests/selenium_test.py