Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
a7fb2e2f
Commit
a7fb2e2f
authored
Jun 29, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix broken tests
parent
a871d5f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
7 deletions
+29
-7
edx_proctoring/api.py
+2
-4
edx_proctoring/serializers.py
+1
-2
edx_proctoring/tests/test_serializer.py
+1
-0
edx_proctoring/tests/test_services.py
+25
-0
edx_proctoring/views.py
+0
-1
No files found.
edx_proctoring/api.py
View file @
a7fb2e2f
...
@@ -8,7 +8,7 @@ API which is in the views.py file, per edX coding standards
...
@@ -8,7 +8,7 @@ API which is in the views.py file, per edX coding standards
"""
"""
import
pytz
import
pytz
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
django.template
import
Context
,
Template
,
loader
from
django.template
import
Context
,
loader
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
edx_proctoring.exceptions
import
(
from
edx_proctoring.exceptions
import
(
...
@@ -226,10 +226,8 @@ def get_student_view(user_id, course_id, content_id, context):
...
@@ -226,10 +226,8 @@ def get_student_view(user_id, course_id, content_id, context):
exam_id
=
None
exam_id
=
None
try
:
try
:
exam
=
get_exam_by_content_id
(
course_id
,
content_id
)
exam
=
get_exam_by_content_id
(
course_id
,
content_id
)
print
'**** exam = {}'
.
format
(
exam
)
exam_id
=
exam
[
'id'
]
exam_id
=
exam
[
'id'
]
except
Exception
,
ex
:
except
ProctoredExamNotFoundException
:
print
'*** exception = {}'
.
format
(
unicode
(
ex
))
exam_id
=
create_exam
(
exam_id
=
create_exam
(
course_id
=
course_id
,
course_id
=
course_id
,
content_id
=
unicode
(
content_id
),
content_id
=
unicode
(
content_id
),
...
...
edx_proctoring/serializers.py
View file @
a7fb2e2f
"""Defines serializers used by the Proctoring API."""
"""Defines serializers used by the Proctoring API."""
from
django.conf
import
settings
from
rest_framework
import
serializers
from
rest_framework
import
serializers
from
edx_proctoring.models
import
ProctoredExam
,
ProctoredExamStudentAttempt
,
ProctoredExamStudentAllowance
from
edx_proctoring.models
import
ProctoredExam
,
ProctoredExamStudentAttempt
,
ProctoredExamStudentAllowance
...
@@ -21,7 +20,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
...
@@ -21,7 +20,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
"""
"""
Serializer for the ProctoredExam Model.
Serializer for the ProctoredExam Model.
"""
"""
id
=
serializers
.
IntegerField
(
required
=
Tru
e
)
id
=
serializers
.
IntegerField
(
required
=
Fals
e
)
course_id
=
serializers
.
CharField
(
required
=
True
)
course_id
=
serializers
.
CharField
(
required
=
True
)
content_id
=
serializers
.
CharField
(
required
=
True
)
content_id
=
serializers
.
CharField
(
required
=
True
)
external_id
=
serializers
.
CharField
(
required
=
True
)
external_id
=
serializers
.
CharField
(
required
=
True
)
...
...
edx_proctoring/tests/test_serializer.py
View file @
a7fb2e2f
...
@@ -15,6 +15,7 @@ class TestProctoredExamSerializer(unittest.TestCase):
...
@@ -15,6 +15,7 @@ class TestProctoredExamSerializer(unittest.TestCase):
Tests the boolean fields. Should cause a validation error in case a field is required.
Tests the boolean fields. Should cause a validation error in case a field is required.
"""
"""
data
=
{
data
=
{
'id'
:
"123"
,
'course_id'
:
"a/b/c"
,
'course_id'
:
"a/b/c"
,
'exam_name'
:
"midterm1"
,
'exam_name'
:
"midterm1"
,
'content_id'
:
'123aXqe0'
,
'content_id'
:
'123aXqe0'
,
...
...
edx_proctoring/tests/test_services.py
0 → 100644
View file @
a7fb2e2f
"""
Test for the xBlock service
"""
import
unittest
from
edx_proctoring.services
import
ProctoringService
from
edx_proctoring
import
api
as
edx_proctoring_api
import
types
class
TestProctoringService
(
unittest
.
TestCase
):
"""
Tests for ProctoringService
"""
def
test_basic
(
self
):
"""
See if the ProctoringService exposes the expected methods
"""
service
=
ProctoringService
()
for
attr_name
in
dir
(
edx_proctoring_api
):
attr
=
getattr
(
edx_proctoring_api
,
attr_name
,
None
)
if
isinstance
(
attr
,
types
.
FunctionType
)
and
not
attr_name
.
startswith
(
'_'
):
self
.
assertTrue
(
hasattr
(
service
,
attr_name
))
edx_proctoring/views.py
View file @
a7fb2e2f
...
@@ -7,7 +7,6 @@ import pytz
...
@@ -7,7 +7,6 @@ import pytz
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
django.utils.decorators
import
method_decorator
from
django.utils.decorators
import
method_decorator
from
django.db
import
IntegrityError
from
rest_framework
import
status
from
rest_framework
import
status
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment