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
6963c530
Commit
6963c530
authored
Jun 02, 2016
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deactivate translations after all i18n tests in courseware so that they don't leak to future tests
parent
387f968c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
lms/djangoapps/courseware/tests/test_i18n.py
+5
-0
No files found.
lms/djangoapps/courseware/tests/test_i18n.py
View file @
6963c530
...
...
@@ -9,6 +9,7 @@ from django.contrib.auth.models import User
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
django.test
import
TestCase
from
django.test.client
import
Client
from
django.utils
import
translation
from
dark_lang.models
import
DarkLangConfig
from
lang_pref
import
LANGUAGE_KEY
...
...
@@ -21,6 +22,10 @@ class BaseI18nTestCase(TestCase):
Base utilities for i18n test classes to derive from
"""
def
setUp
(
self
):
super
(
BaseI18nTestCase
,
self
)
.
setUp
()
self
.
addCleanup
(
translation
.
deactivate
)
def
assert_tag_has_attr
(
self
,
content
,
tag
,
attname
,
value
):
"""Assert that a tag in `content` has a certain value in a certain attribute."""
regex
=
r"""<{tag} [^>]*\b{attname}=['"]([\w\d\- ]+)['"][^>]*>"""
.
format
(
tag
=
tag
,
attname
=
attname
)
...
...
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