diff --git a/.travis.yml b/.travis.yml index 737615c8b38..bff27661c36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: python cache: pip python: - 2.7 +services: +- xvfb env: - DJANGO_SETTINGS_MODULE=test_setting TOXENV=django111-drf37 - DJANGO_SETTINGS_MODULE=test_setting TOXENV=django111-drf38 @@ -12,7 +14,6 @@ env: - TOXENV=translations before_install: - export DISPLAY=:99.0 -- sh -e /etc/init.d/xvfb start install: - pip install tox-travis - pip install -r requirements/test.txt diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 5bd7fd6b4d7..e8fcfa3d825 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -5,6 +5,6 @@ from __future__ import absolute_import # Be sure to update the version number in edx_proctoring/package.json -__version__ = '2.0.3' +__version__ = '2.0.4' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/tests/test_views.py b/edx_proctoring/tests/test_views.py index a4185440b28..4e4117c9c85 100644 --- a/edx_proctoring/tests/test_views.py +++ b/edx_proctoring/tests/test_views.py @@ -41,6 +41,8 @@ from edx_proctoring.runtime import set_runtime_service, get_runtime_service from edx_proctoring.urls import urlpatterns +from mock_apps.models import Profile + from .test_services import MockCreditService, MockInstructorService from .utils import LoggedInTestCase @@ -2600,6 +2602,10 @@ class TestInstructorDashboard(LoggedInTestCase): """ def setUp(self): super(TestInstructorDashboard, self).setUp() + profile = Profile() + profile.name = 'boo radley' + profile.user = self.user + profile.save() self.user.is_staff = True self.user.save() self.second_user = User(username='tester2', email='tester2@test.com') diff --git a/edx_proctoring/views.py b/edx_proctoring/views.py index 49ea03ca225..2da914bca18 100644 --- a/edx_proctoring/views.py +++ b/edx_proctoring/views.py @@ -1040,7 +1040,7 @@ def get(self, request, course_id, exam_id=None): if backend: user = { 'id': obscured_user_id(request.user.id, exam['backend']), - 'full_name': request.user.get_full_name(), + 'full_name': request.user.profile.name, 'email': request.user.email } diff --git a/mock_apps/__init__.py b/mock_apps/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mock_apps/apps.py b/mock_apps/apps.py new file mode 100644 index 00000000000..4745e1132fb --- /dev/null +++ b/mock_apps/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class MockAppsConfig(AppConfig): + name = 'mock_apps' diff --git a/mock_apps/models.py b/mock_apps/models.py new file mode 100644 index 00000000000..9d1968e975c --- /dev/null +++ b/mock_apps/models.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib.auth import get_user_model +from django.db import models + +class Profile(models.Model): + user = models.OneToOneField(get_user_model()) + name = models.CharField(max_length=100) + diff --git a/package.json b/package.json index c45464705aa..578f2439a33 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@edx/edx-proctoring", "//": "Be sure to update the version number in edx_proctoring/__init__.py", "//": "Note that the version format is slightly different than that of the Python version when using prereleases.", - "version": "2.0.3", + "version": "2.0.4", "main": "edx_proctoring/static/index.js", "repository": { "type": "git", diff --git a/test_settings.py b/test_settings.py index 0cc469b641e..9cc90019787 100644 --- a/test_settings.py +++ b/test_settings.py @@ -49,6 +49,7 @@ 'edx_when', 'rules.apps.AutodiscoverRulesConfig', 'waffle', + 'mock_apps', ) AUTHENTICATION_BACKENDS = [