Commit Graph

36 Commits

Author SHA1 Message Date
M. Zulqarnain
fa271dafe9 BOM-2369 (C): pyupgrade on contentstore/tests (#26759)
* pyupgrade on contentstore/tests
2021-03-04 14:37:39 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
9610aab0f8 Fix more cms contentstore tests. 2019-10-08 15:26:52 -04:00
uzairr
a35b452877 NullTranslations object doesn't have ugettext attribute
Some of the tests are failing because NullTranslations object is
behaving differently with py2 and py3.With py2, it has 'ugettext'
attribute but with py3 it doesn't have.To make it compliant with
both versions modifications in the tests have been added so that
build will not fail.

PROD-663
2019-09-26 21:37:38 +05:00
aarif
f39e6c5914 minor fixes 2019-09-26 16:18:31 +05:00
aarif
7eef705bbe python 3 fixes
minor fixes
2019-09-26 15:42:07 +05:00
aarif
00f42fbd9a python 3 fixes
python 3 fixes

python 3 fixes

python 3 fixes

minor changes
2019-09-25 18:47:37 +05:00
uzairr
930bf84188 DjangoTranslation object doesn't have ugettext attribute
Some of the tests are failing because DjangoTranslation object is
behaving differently with py2 and py3.With py2, it has 'ugettext'
attribute but with py3 it doesn't have.To make it compliant with
both versions modifications in the tests have been added so that
build will not fail.

PROD-664
2019-09-25 13:31:39 +05:00
Ayub khan
4ed93be5ff INCR-328 python3 compatibility 2019-07-09 13:09:08 +05:00
Shadi Naif
4df2073376 Fix exceptions raised when a lazy text is used in json dump 2018-11-05 12:24:45 +02:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
Calen Pennington
105308e129 Use translation.deactivate, rather than explicitly activating the current settings LANGUAGE_CODE 2016-06-02 11:06:59 -04:00
Calen Pennington
18e1610043 Remove the create_user argument to setUp.
Instead, use a class attribute to define test behavior. This allows for
easier addition of new mixins over time.
2016-05-04 11:35:55 -04:00
Régis Behmo
e850ef2db2 Fix broken French i18n in CMS tests
French ugettext method was being monkey-patched with a "XYZ " prefix in
all tests. This introduces a context manager to guarantee that the
function reverts to its original state after the unit test has ended
(successfuly or not).
2016-04-04 18:28:26 +02:00
Matt Drayer
3ed3fea2fb mattdrayer/xblock-translations: Add I18N/L10N support to XBlocks via the runtime
* mattdrayer:  Latest proto code
* mattdrayer:  Add translation.py
* asadiqbal08: Xblock translation ugettext update, remove translation.py
* mattdrayer:  Additional I18N work -- starting to see some translations!
* asadiqbal08: Trying to make xBlock message catalog files path dynamic
* mattdrayer:  Remove unnecessary modifications
* mattdrayer:  Cleaned up implementation
* mattdrayer:  Moved import statement
* asadiqbal08: update as suggested
* asadiqbal08: xblock its own domain
* asadiqbal08: translation: secure none object
* asadiqbal08: pylint
* asadiqbal08: get locale from xblock
* asadiqbal08: update
* mattdrayer:  Determine XBlock locale path within runtime service
* mattdrayer:  Determine module location via the runtime
* mattdrayer:  Remove ModuleI18nService reference
* asadiqbal08: override the service in studio
* asadiqbal08: remove import
* asadiqbal08: update the Modulei18nService
* asadiqbal08: update the Modulei18nService
* mattdrayer:  Remove redundant __class__ reference
* asadiqbal08: update the docstring
* asadiqbal08: tests
* mattdrayer:  Remove specific ugettext override from ModuleI18nService
* mattdrayer:  Move service operation to base class
* mattdrayer:  Address quality violations
* asadiqbal08: Investigating the test failure issue on jenkins and solved
* asadiqbal08: First utilizing the parent class method
* mattdrayer:  Use recommended callable approach
* asadiqbal08: remove unused code
* asadiqbal08: Updated the test to use cms preview module system runtime in order to get i18n service.
* asadiqbal08: Pylint quality
* asadiqbal08: update the service call to check xblock declarations
* asadiqbal08: update doc string
* asadiqbal08: i18n callable test in studio
* asadiqbal08: test lms runtime for modulei18n service
* asadiqbal08: add doc strings
* asadiqbal08: Rename locale and domain to Flask-Babel convention
2016-03-11 09:55:15 -05:00
Calen Pennington
03a05fd9d4 Always call super(..).setUp() from setUp 2015-02-04 09:09:14 -05:00
Jonathan Piacenti
eabd6c8d27 Quality check and test fixes. 2015-01-12 13:41:03 +03:00
stv
b215d771b7 Fix PEP8: E128 continuation line under-indented
for visual indent
2014-11-24 20:46:50 -05:00
stv
5a69feadeb Fix PEP8: E123 closing bracket does not match
indentation of opening bracket's line
2014-11-24 20:46:44 -05:00
Nimisha Asthagiri
a9213509c3 Enable Mixed Modulestore STUD-1540
Refactor get_parent_locations STUD-1663
2014-06-26 18:00:11 -04:00
Calen Pennington
0d88379eeb Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds all of cms.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:56:43 -04:00
Sarina Canelake
bd8fce5a8a Change dummy locale to Esperanto 2013-11-19 10:28:02 -05:00
Don Mitchell
f41816637e RESTful refactoring of /course access continued
Move index access into the url
Move course creation into the url
Add helper methods for testing to serialize json data and set accept header.
2013-10-30 13:28:22 -04:00
Will Daly
e50a2414b2 Studio ModuleStoreTestCase subclasses now use randomized Mongo
collection names
2013-08-27 12:57:14 -04:00
David Baumgold
248793c127 Fix some pylint issues 2013-07-31 15:42:11 -04:00
Don Mitchell
3722685e1a No longer persist XModule templates
Instead, we use XModule field default values when creating an empty
XModule. Driven by this use case, we also allow for XModules to be
created in memory without being persisted to the database at all. This
necessitates a change to the Modulestore api, replacing clone_item with
create_draft and save_xmodule.
2013-07-16 14:33:58 -04:00
Chris Dodge
6cec66979a fix broken tests. Also drive by fix for the sporadic failure on tests which may go to a textbook page. The URL formatting was incorrect in the test 2013-05-15 11:16:47 -04:00
Chris Dodge
4d197e10ec fix some violations. Build up karma 2013-05-13 11:10:11 -04:00
Steve Strassmann
dd71ae818a ModuleStoreTestCase moved to new location 2013-04-24 11:33:47 -04:00
Steve Strassmann
111ec62bb6 merged from master 2013-04-24 10:42:35 -04:00
Steve Strassmann
6f10348836 addressed comments from pull request 2013-04-23 10:07:51 -04:00
Steve Strassmann
2f84b23047 disable i18n unit test - it wont run without creating dummy strings first 2013-04-17 13:20:20 -04:00
Steve Strassmann
6e34c668bb introduce i18n 2013-04-17 11:30:29 -04:00