Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
0b7e7b35
Commit
0b7e7b35
authored
Jan 24, 2013
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stub out django comment client test system
parent
22ccf9c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
lms/djangoapps/django_comment_client/tests.py
+48
-2
No files found.
lms/djangoapps/django_comment_client/tests.py
View file @
0b7e7b35
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
,
Group
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
from
django.test.client
import
RequestFactory
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
override_settings
import
override_settings
import
xmodule.modulestore.django
from
student.models
import
CourseEnrollment
,
\
replicate_enrollment_save
,
\
replicate_enrollment_delete
,
\
update_user_information
,
\
replicate_user_save
from
django.db.models.signals
import
m2m_changed
,
pre_delete
,
pre_save
,
post_delete
,
post_save
from
django.dispatch.dispatcher
import
_make_id
import
string
...
...
@@ -13,6 +21,44 @@ import random
from
.permissions
import
has_permission
from
.models
import
Role
,
Permission
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.modulestore.xml
import
XMLModuleStore
from
courseware.tests.tests
import
PageLoader
,
TEST_DATA_XML_MODULESTORE
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
TestCohorting
(
PageLoader
):
"""Check that cohorting works properly"""
def
setUp
(
self
):
xmodule
.
modulestore
.
django
.
_MODULESTORES
=
{}
# Assume courses are there
self
.
toy
=
modulestore
()
.
get_course
(
"edX/toy/2012_Fall"
)
# Create two accounts
self
.
student
=
'view@test.com'
self
.
student2
=
'view2@test.com'
self
.
password
=
'foo'
self
.
create_account
(
'u1'
,
self
.
student
,
self
.
password
)
self
.
create_account
(
'u2'
,
self
.
student2
,
self
.
password
)
self
.
activate_user
(
self
.
student
)
self
.
activate_user
(
self
.
student2
)
def
test_create_thread
(
self
):
resp
=
self
.
client
.
post
(
reverse
(
'create_thread'
),
{
'some'
:
"some"
,
'data'
:
'data'
})
self
.
assertEqual
(
resp
.
status_code
,
200
)
class
PermissionsTestCase
(
TestCase
):
def
random_str
(
self
,
length
=
15
,
chars
=
string
.
ascii_uppercase
+
string
.
digits
):
return
''
.
join
(
random
.
choice
(
chars
)
for
x
in
range
(
length
))
...
...
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