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
b2a63b79
Commit
b2a63b79
authored
Apr 16, 2015
by
Zia Fazal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing issues to make sure all tests pass on cmd
parent
c7d84182
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
281 additions
and
20 deletions
+281
-20
cms/envs/test.py
+3
-0
common/djangoapps/student/tests/test_create_account.py
+1
-0
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+1
-1
lms/djangoapps/courseware/management/commands/tests/test_delete_course_references.py
+5
-4
lms/djangoapps/instructor/tests/test_receivers.py
+7
-5
lms/djangoapps/social_engagement/management/commands/tests/tests.py
+5
-4
lms/djangoapps/social_engagement/tests/test_engagement.py
+6
-6
openedx/core/djangoapps/user_api/tests/test_constants.py
+253
-0
No files found.
cms/envs/test.py
View file @
b2a63b79
...
...
@@ -163,6 +163,9 @@ INSTALLED_APPS += ('external_auth', )
# Add milestones to Installed apps for testing
INSTALLED_APPS
+=
(
'milestones'
,
)
# Add projects, organizations,'api_manager', 'progress', 'gradebook to Installed apps for testing
INSTALLED_APPS
+=
(
'projects'
,
'organizations'
,
'api_manager'
,
'progress'
,
'gradebook'
,
)
# hide ratelimit warnings while running tests
filterwarnings
(
'ignore'
,
message
=
'No request passed to the backend, unable to rate-limit'
)
...
...
common/djangoapps/student/tests/test_create_account.py
View file @
b2a63b79
"Tests for account creation"
import
ddt
import
unittest
from
django.contrib.auth.models
import
User
from
django.test.client
import
RequestFactory
from
django.conf
import
settings
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
b2a63b79
...
...
@@ -44,7 +44,7 @@ from xmodule.errortracker import null_error_tracker, exc_info_to_str
from
xmodule.exceptions
import
HeartbeatFailure
from
xmodule.mako_module
import
MakoDescriptorSystem
from
xmodule.modulestore
import
ModuleStoreWriteBase
,
ModuleStoreEnum
,
BulkOperationsMixin
,
BulkOpsRecord
from
xmodule.se
ttings_service
import
SettingsService
from
xmodule.se
rvices
import
SettingsService
from
xmodule.modulestore.draft_and_published
import
ModuleStoreDraftAndPublished
,
DIRECT_ONLY_CATEGORIES
from
xmodule.modulestore.edit_info
import
EditInfoRuntimeMixin
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
DuplicateCourseError
,
ReferentialIntegrityError
...
...
lms/djangoapps/courseware/management/commands/tests/test_delete_course_references.py
View file @
b2a63b79
...
...
@@ -7,13 +7,14 @@ import uuid
from
django.conf
import
settings
from
django.contrib.auth.models
import
Group
,
User
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
courseware.management.commands
import
delete_course_references
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
mixed_store_config
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
if
settings
.
FEATURES
.
get
(
'API'
,
False
):
from
api_manager.models
import
GroupProfile
,
CourseGroupRelationship
,
CourseContentGroupRelationship
...
...
@@ -27,8 +28,8 @@ if settings.FEATURES.get('STUDENT_PROGRESS', False):
from
progress
import
models
as
progress_models
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
DeleteCourseReferencesTests
(
TestCase
):
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
class
DeleteCourseReferencesTests
(
ModuleStore
TestCase
):
"""
Test suite for course reference deletion script
"""
...
...
lms/djangoapps/instructor/tests/test_receivers.py
View file @
b2a63b79
...
...
@@ -6,20 +6,22 @@ Run these tests @ Devstack:
from
datetime
import
datetime
import
uuid
from
django.con
trib.auth.models
import
Group
,
User
from
django.
test
import
TestCase
from
django.con
f
import
settings
from
django.
contrib.auth.models
import
User
from
django.test.utils
import
override_settings
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
mixed_store_config
from
util.signals
import
course_deleted
from
student.models
import
CourseAccessRole
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
InstructorReceiversTests
(
TestCase
):
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
class
InstructorReceiversTests
(
ModuleStoreTestCase
):
""" Test suite for signal receivers """
def
setUp
(
self
):
...
...
lms/djangoapps/social_engagement/management/commands/tests/tests.py
View file @
b2a63b79
...
...
@@ -8,13 +8,12 @@ from django.conf import settings
from
mock
import
MagicMock
,
patch
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
from
student.tests.factories
import
UserFactory
from
student.models
import
CourseEnrollment
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
mixed_store_config
from
social_engagement.models
import
StudentSocialEngagementScore
,
StudentSocialEngagementScoreHistory
from
social_engagement.engagement
import
update_user_engagement_score
...
...
@@ -26,11 +25,13 @@ from edx_notifications.lib.consumer import get_notifications_count_for_user
from
social_engagement.management.commands.generate_engagement_entries
import
Command
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_NOTIFICATIONS'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SOCIAL_ENGAGEMENT'
:
True
})
class
StudentEngagementTests
(
TestCase
):
class
StudentEngagementTests
(
ModuleStore
TestCase
):
""" Test suite for CourseModuleCompletion """
def
setUp
(
self
):
...
...
lms/djangoapps/social_engagement/tests/test_engagement.py
View file @
b2a63b79
...
...
@@ -7,18 +7,16 @@ paver test_system -s lms --test_id=lms/djangoapps/social_engagements/tests/test_
from
django.conf
import
settings
from
django.db
import
IntegrityError
from
mock
import
MagicMock
,
patch
from
mock
import
patch
from
datetime
import
datetime
,
timedelta
import
pytz
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
courseware.tests.modulestore_config
import
TEST_DATA_MIXED_MODULESTORE
from
student.tests.factories
import
UserFactory
from
student.models
import
CourseEnrollment
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
mixed_store_config
from
social_engagement.models
import
StudentSocialEngagementScore
,
StudentSocialEngagementScoreHistory
...
...
@@ -29,11 +27,13 @@ from social_engagement.engagement import update_all_courses_engagement_scores
from
edx_notifications.startup
import
initialize
as
initialize_notifications
from
edx_notifications.lib.consumer
import
get_notifications_count_for_user
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_NOTIFICATIONS'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SOCIAL_ENGAGEMENT'
:
True
})
class
StudentEngagementTests
(
TestCase
):
class
StudentEngagementTests
(
ModuleStore
TestCase
):
""" Test suite for CourseModuleCompletion """
def
setUp
(
self
):
...
...
openedx/core/djangoapps/user_api/tests/test_constants.py
0 → 100644
View file @
b2a63b79
"""Constants used in the test suite. """
SORTED_COUNTRIES
=
[
(
u'AF'
,
u'Afghanistan'
),
(
u'AL'
,
u'Albania'
),
(
u'DZ'
,
u'Algeria'
),
(
u'AS'
,
u'American Samoa'
),
(
u'AD'
,
u'Andorra'
),
(
u'AO'
,
u'Angola'
),
(
u'AI'
,
u'Anguilla'
),
(
u'AQ'
,
u'Antarctica'
),
(
u'AG'
,
u'Antigua and Barbuda'
),
(
u'AR'
,
u'Argentina'
),
(
u'AM'
,
u'Armenia'
),
(
u'AW'
,
u'Aruba'
),
(
u'AU'
,
u'Australia'
),
(
u'AT'
,
u'Austria'
),
(
u'AZ'
,
u'Azerbaijan'
),
(
u'BS'
,
u'Bahamas'
),
(
u'BH'
,
u'Bahrain'
),
(
u'BD'
,
u'Bangladesh'
),
(
u'BB'
,
u'Barbados'
),
(
u'BY'
,
u'Belarus'
),
(
u'BE'
,
u'Belgium'
),
(
u'BZ'
,
u'Belize'
),
(
u'BJ'
,
u'Benin'
),
(
u'BM'
,
u'Bermuda'
),
(
u'BT'
,
u'Bhutan'
),
(
u'BO'
,
u'Bolivia, Plurinational State of'
),
(
u'BQ'
,
u'Bonaire, Sint Eustatius and Saba'
),
(
u'BA'
,
u'Bosnia and Herzegovina'
),
(
u'BW'
,
u'Botswana'
),
(
u'BV'
,
u'Bouvet Island'
),
(
u'BR'
,
u'Brazil'
),
(
u'IO'
,
u'British Indian Ocean Territory'
),
(
u'BN'
,
u'Brunei Darussalam'
),
(
u'BG'
,
u'Bulgaria'
),
(
u'BF'
,
u'Burkina Faso'
),
(
u'BI'
,
u'Burundi'
),
(
u'KH'
,
u'Cambodia'
),
(
u'CM'
,
u'Cameroon'
),
(
u'CA'
,
u'Canada'
),
(
u'CV'
,
u'Cape Verde'
),
(
u'KY'
,
u'Cayman Islands'
),
(
u'CF'
,
u'Central African Republic'
),
(
u'TD'
,
u'Chad'
),
(
u'CL'
,
u'Chile'
),
(
u'CN'
,
u'China'
),
(
u'CX'
,
u'Christmas Island'
),
(
u'CC'
,
u'Cocos (Keeling) Islands'
),
(
u'CO'
,
u'Colombia'
),
(
u'KM'
,
u'Comoros'
),
(
u'CG'
,
u'Congo'
),
(
u'CD'
,
u'Congo (the Democratic Republic of the)'
),
(
u'CK'
,
u'Cook Islands'
),
(
u'CR'
,
u'Costa Rica'
),
(
u'HR'
,
u'Croatia'
),
(
u'CU'
,
u'Cuba'
),
(
u'CW'
,
u'Cura
\xe7
ao'
),
(
u'CY'
,
u'Cyprus'
),
(
u'CZ'
,
u'Czech Republic'
),
(
u'CI'
,
u"C
\xf4
te d'Ivoire"
),
(
u'DK'
,
u'Denmark'
),
(
u'DJ'
,
u'Djibouti'
),
(
u'DM'
,
u'Dominica'
),
(
u'DO'
,
u'Dominican Republic'
),
(
u'EC'
,
u'Ecuador'
),
(
u'EG'
,
u'Egypt'
),
(
u'SV'
,
u'El Salvador'
),
(
u'GQ'
,
u'Equatorial Guinea'
),
(
u'ER'
,
u'Eritrea'
),
(
u'EE'
,
u'Estonia'
),
(
u'ET'
,
u'Ethiopia'
),
(
u'FK'
,
u'Falkland Islands [Malvinas]'
),
(
u'FO'
,
u'Faroe Islands'
),
(
u'FJ'
,
u'Fiji'
),
(
u'FI'
,
u'Finland'
),
(
u'FR'
,
u'France'
),
(
u'GF'
,
u'French Guiana'
),
(
u'PF'
,
u'French Polynesia'
),
(
u'TF'
,
u'French Southern Territories'
),
(
u'GA'
,
u'Gabon'
),
(
u'GM'
,
u'Gambia (The)'
),
(
u'GE'
,
u'Georgia'
),
(
u'DE'
,
u'Germany'
),
(
u'GH'
,
u'Ghana'
),
(
u'GI'
,
u'Gibraltar'
),
(
u'GR'
,
u'Greece'
),
(
u'GL'
,
u'Greenland'
),
(
u'GD'
,
u'Grenada'
),
(
u'GP'
,
u'Guadeloupe'
),
(
u'GU'
,
u'Guam'
),
(
u'GT'
,
u'Guatemala'
),
(
u'GG'
,
u'Guernsey'
),
(
u'GN'
,
u'Guinea'
),
(
u'GW'
,
u'Guinea-Bissau'
),
(
u'GY'
,
u'Guyana'
),
(
u'HT'
,
u'Haiti'
),
(
u'HM'
,
u'Heard Island and McDonald Islands'
),
(
u'VA'
,
u'Holy See [Vatican City State]'
),
(
u'HN'
,
u'Honduras'
),
(
u'HK'
,
u'Hong Kong'
),
(
u'HU'
,
u'Hungary'
),
(
u'IS'
,
u'Iceland'
),
(
u'IN'
,
u'India'
),
(
u'ID'
,
u'Indonesia'
),
(
u'IR'
,
u'Iran (the Islamic Republic of)'
),
(
u'IQ'
,
u'Iraq'
),
(
u'IE'
,
u'Ireland'
),
(
u'IM'
,
u'Isle of Man'
),
(
u'IL'
,
u'Israel'
),
(
u'IT'
,
u'Italy'
),
(
u'JM'
,
u'Jamaica'
),
(
u'JP'
,
u'Japan'
),
(
u'JE'
,
u'Jersey'
),
(
u'JO'
,
u'Jordan'
),
(
u'KZ'
,
u'Kazakhstan'
),
(
u'KE'
,
u'Kenya'
),
(
u'KI'
,
u'Kiribati'
),
(
u'KP'
,
u"Korea (the Democratic People's Republic of)"
),
(
u'KR'
,
u'Korea (the Republic of)'
),
(
u'KW'
,
u'Kuwait'
),
(
u'KG'
,
u'Kyrgyzstan'
),
(
u'LA'
,
u"Lao People's Democratic Republic"
),
(
u'LV'
,
u'Latvia'
),
(
u'LB'
,
u'Lebanon'
),
(
u'LS'
,
u'Lesotho'
),
(
u'LR'
,
u'Liberia'
),
(
u'LY'
,
u'Libya'
),
(
u'LI'
,
u'Liechtenstein'
),
(
u'LT'
,
u'Lithuania'
),
(
u'LU'
,
u'Luxembourg'
),
(
u'MO'
,
u'Macao'
),
(
u'MK'
,
u'Macedonia (the former Yugoslav Republic of)'
),
(
u'MG'
,
u'Madagascar'
),
(
u'MW'
,
u'Malawi'
),
(
u'MY'
,
u'Malaysia'
),
(
u'MV'
,
u'Maldives'
),
(
u'ML'
,
u'Mali'
),
(
u'MT'
,
u'Malta'
),
(
u'MH'
,
u'Marshall Islands'
),
(
u'MQ'
,
u'Martinique'
),
(
u'MR'
,
u'Mauritania'
),
(
u'MU'
,
u'Mauritius'
),
(
u'YT'
,
u'Mayotte'
),
(
u'MX'
,
u'Mexico'
),
(
u'FM'
,
u'Micronesia (the Federated States of)'
),
(
u'MD'
,
u'Moldova (the Republic of)'
),
(
u'MC'
,
u'Monaco'
),
(
u'MN'
,
u'Mongolia'
),
(
u'ME'
,
u'Montenegro'
),
(
u'MS'
,
u'Montserrat'
),
(
u'MA'
,
u'Morocco'
),
(
u'MZ'
,
u'Mozambique'
),
(
u'MM'
,
u'Myanmar'
),
(
u'NA'
,
u'Namibia'
),
(
u'NR'
,
u'Nauru'
),
(
u'NP'
,
u'Nepal'
),
(
u'NL'
,
u'Netherlands'
),
(
u'NC'
,
u'New Caledonia'
),
(
u'NZ'
,
u'New Zealand'
),
(
u'NI'
,
u'Nicaragua'
),
(
u'NE'
,
u'Niger'
),
(
u'NG'
,
u'Nigeria'
),
(
u'NU'
,
u'Niue'
),
(
u'NF'
,
u'Norfolk Island'
),
(
u'MP'
,
u'Northern Mariana Islands'
),
(
u'NO'
,
u'Norway'
),
(
u'OM'
,
u'Oman'
),
(
u'PK'
,
u'Pakistan'
),
(
u'PW'
,
u'Palau'
),
(
u'PS'
,
u'Palestine, State of'
),
(
u'PA'
,
u'Panama'
),
(
u'PG'
,
u'Papua New Guinea'
),
(
u'PY'
,
u'Paraguay'
),
(
u'PE'
,
u'Peru'
),
(
u'PH'
,
u'Philippines'
),
(
u'PN'
,
u'Pitcairn'
),
(
u'PL'
,
u'Poland'
),
(
u'PT'
,
u'Portugal'
),
(
u'PR'
,
u'Puerto Rico'
),
(
u'QA'
,
u'Qatar'
),
(
u'RO'
,
u'Romania'
),
(
u'RU'
,
u'Russian Federation'
),
(
u'RW'
,
u'Rwanda'
),
(
u'RE'
,
u'R
\xe9
union'
),
(
u'BL'
,
u'Saint Barth
\xe9
lemy'
),
(
u'SH'
,
u'Saint Helena, Ascension and Tristan da Cunha'
),
(
u'KN'
,
u'Saint Kitts and Nevis'
),
(
u'LC'
,
u'Saint Lucia'
),
(
u'MF'
,
u'Saint Martin (French part)'
),
(
u'PM'
,
u'Saint Pierre and Miquelon'
),
(
u'VC'
,
u'Saint Vincent and the Grenadines'
),
(
u'WS'
,
u'Samoa'
),
(
u'SM'
,
u'San Marino'
),
(
u'ST'
,
u'Sao Tome and Principe'
),
(
u'SA'
,
u'Saudi Arabia'
),
(
u'SN'
,
u'Senegal'
),
(
u'RS'
,
u'Serbia'
),
(
u'SC'
,
u'Seychelles'
),
(
u'SL'
,
u'Sierra Leone'
),
(
u'SG'
,
u'Singapore'
),
(
u'SX'
,
u'Sint Maarten (Dutch part)'
),
(
u'SK'
,
u'Slovakia'
),
(
u'SI'
,
u'Slovenia'
),
(
u'SB'
,
u'Solomon Islands'
),
(
u'SO'
,
u'Somalia'
),
(
u'ZA'
,
u'South Africa'
),
(
u'GS'
,
u'South Georgia and the South Sandwich Islands'
),
(
u'SS'
,
u'South Sudan'
),
(
u'ES'
,
u'Spain'
),
(
u'LK'
,
u'Sri Lanka'
),
(
u'SD'
,
u'Sudan'
),
(
u'SR'
,
u'Suriname'
),
(
u'SJ'
,
u'Svalbard and Jan Mayen'
),
(
u'SZ'
,
u'Swaziland'
),
(
u'SE'
,
u'Sweden'
),
(
u'CH'
,
u'Switzerland'
),
(
u'SY'
,
u'Syrian Arab Republic'
),
(
u'TW'
,
u'Taiwan'
),
(
u'TJ'
,
u'Tajikistan'
),
(
u'TZ'
,
u'Tanzania, United Republic of'
),
(
u'TH'
,
u'Thailand'
),
(
u'TL'
,
u'Timor-Leste'
),
(
u'TG'
,
u'Togo'
),
(
u'TK'
,
u'Tokelau'
),
(
u'TO'
,
u'Tonga'
),
(
u'TT'
,
u'Trinidad and Tobago'
),
(
u'TN'
,
u'Tunisia'
),
(
u'TR'
,
u'Turkey'
),
(
u'TM'
,
u'Turkmenistan'
),
(
u'TC'
,
u'Turks and Caicos Islands'
),
(
u'TV'
,
u'Tuvalu'
),
(
u'UG'
,
u'Uganda'
),
(
u'UA'
,
u'Ukraine'
),
(
u'AE'
,
u'United Arab Emirates'
),
(
u'GB'
,
u'United Kingdom'
),
(
u'US'
,
u'United States'
),
(
u'UM'
,
u'United States Minor Outlying Islands'
),
(
u'UY'
,
u'Uruguay'
),
(
u'UZ'
,
u'Uzbekistan'
),
(
u'VU'
,
u'Vanuatu'
),
(
u'VE'
,
u'Venezuela, Bolivarian Republic of'
),
(
u'VN'
,
u'Viet Nam'
),
(
u'VG'
,
u'Virgin Islands (British)'
),
(
u'VI'
,
u'Virgin Islands (U.S.)'
),
(
u'WF'
,
u'Wallis and Futuna'
),
(
u'EH'
,
u'Western Sahara'
),
(
u'YE'
,
u'Yemen'
),
(
u'ZM'
,
u'Zambia'
),
(
u'ZW'
,
u'Zimbabwe'
),
(
u'AX'
,
u'
\xc5
land Islands'
)
]
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