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
d867e87b
Commit
d867e87b
authored
Feb 06, 2014
by
Julia Hansbrough
Committed by
thedeadparrot
Feb 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acceptance test for language selector
Tests language selection feature for student dashboard
parent
a5207708
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
42 deletions
+15
-42
common/djangoapps/student/tests/test_languages.py
+0
-24
common/test/acceptance/pages/lms/dashboard.py
+5
-2
common/test/acceptance/tests/test_lms.py
+7
-7
common/test/db_fixtures/released_lang.json
+1
-1
lms/templates/dashboard/_dashboard_info_language.html
+0
-3
lms/templates/modal/_modal-settings-language.html
+1
-1
rakelib/bok_choy.rake
+1
-1
scripts/reset-test-db.sh
+0
-3
No files found.
common/djangoapps/student/tests/test_languages.py
deleted
100644 → 0
View file @
a5207708
# -*- coding: utf-8 -*-
"""
This test file will verify functionality relating to changing language settings for a user
"""
from
django.test
import
TestCase
from
django.core.urlresolvers
import
reverse
from
student.tests.factories
import
UserFactory
class
TestLanguageSettings
(
TestCase
):
"""
Language settings tests
"""
def
setUp
(
self
):
self
.
user
=
UserFactory
.
create
(
username
=
"rusty"
,
password
=
"test"
)
self
.
client
.
login
(
username
=
"rusty"
,
password
=
"test"
)
def
test_successful_language_change
(
self
):
# Esperanto is our dummy language
post_data
=
dict
(
language
=
'eo'
,)
response
=
self
.
client
.
post
(
'/i18n/setlang/'
,
data
=
post_data
)
self
.
assertEqual
(
response
.
status_code
,
302
)
session
=
self
.
client
.
session
self
.
assertEqual
(
session
[
'django_language'
],
'eo'
)
common/test/acceptance/pages/lms/dashboard.py
View file @
d867e87b
...
...
@@ -61,7 +61,10 @@ class DashboardPage(PageObject):
else
:
return
None
def
change_language
(
self
):
def
change_language
(
self
,
code
):
"""
Change the language on the dashboard to the language corresponding with `code`.
"""
self
.
css_click
(
".edit-language"
)
self
.
select_option
(
"language"
,
"eo"
)
self
.
select_option
(
"language"
,
code
)
self
.
css_click
(
"#submit-lang"
)
common/test/acceptance/tests/test_lms.py
View file @
d867e87b
...
...
@@ -81,17 +81,17 @@ class LanguageTest(UniqueCourseTest):
"""
super
(
LanguageTest
,
self
)
.
setUp
()
self
.
dashboard_page
=
DashboardPage
(
self
.
browser
)
def
test_change_lang
(
self
):
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
)
.
visit
()
self
.
dashboard_page
.
visit
()
# Change language to Esperanto
self
.
dashboard_page
.
change_language
()
self
.
fail
()
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
"eo"
)
self
.
dashboard_page
.
visit
()
body
=
self
.
browser
.
body
matches
=
re
.
match
(
u'^FÏND ÇØÜRSÉS.+$'
,
body
)
self
.
assertTrue
(
matches
is
not
None
)
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
seektext
=
u"
\xc7\xdc
RR
\xc9
NT
\xc7\xd8\xdc
RS
\xc9
S"
self
.
browser
.
is_text_present
(
seektext
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
seektext
))
class
HighLevelTabTest
(
UniqueCourseTest
):
...
...
common/test/db_fixtures/released_lang.json
View file @
d867e87b
[{
"pk"
:
1
,
"model"
:
"dark_lang.darklangconfig"
,
"fields"
:
{
"change_date"
:
"2
014
-01-30T20:34:20Z"
,
"changed_by"
:
null
,
"enabled"
:
true
,
"released_languages"
:
"en,eo"
}}]
[{
"pk"
:
1
,
"model"
:
"dark_lang.darklangconfig"
,
"fields"
:
{
"change_date"
:
"2
100
-01-30T20:34:20Z"
,
"changed_by"
:
null
,
"enabled"
:
true
,
"released_languages"
:
"en,eo"
}}]
lms/templates/dashboard/_dashboard_info_language.html
View file @
d867e87b
...
...
@@ -12,6 +12,3 @@
</span>
<span
class=
"data"
>
${current_language['name_local']}
</span>
</li>
lms/templates/modal/_modal-settings-language.html
View file @
d867e87b
...
...
@@ -37,7 +37,7 @@
<ul
class=
"list-actions"
>
<li
class=
"action-item"
>
<button
type=
"submit"
class=
"action action-submit"
id=
"
#
submit-lang"
>
Save Language
</button>
<button
type=
"submit"
class=
"action action-submit"
id=
"submit-lang"
>
Save Language
</button>
</li>
<li
class=
"action-item"
>
<button
type=
"reset"
class=
"action action-cancel"
>
Cancel
</button>
...
...
rakelib/bok_choy.rake
View file @
d867e87b
...
...
@@ -195,7 +195,7 @@ namespace :'test:bok_choy' do
# Clear any test data already in Mongo or MySQL and invalidate the cache
clear_mongo
()
BOK_CHOY_CACHE
.
flush
()
sh
(
django_admin
(
'lms'
,
'bok_choy'
,
'
flush'
,
'--noinput
'
))
sh
(
django_admin
(
'lms'
,
'bok_choy'
,
'
loaddata'
,
'common/test/db_fixtures/*.json
'
))
# Ensure the test servers are available
puts
"Starting test servers..."
.
green
...
...
scripts/reset-test-db.sh
View file @
d867e87b
...
...
@@ -23,7 +23,6 @@
############################################################################
DB_CACHE_DIR
=
"common/test/db_cache"
DB_FIXTURE_DIR
=
"common/test/db_fixtures"
# Clear out the test database
./manage.py lms
--settings
bok_choy reset_db
--traceback
--noinput
...
...
@@ -53,5 +52,3 @@ else
mysqldump
-u
root
--no-data
--skip-comments
--skip-dump-date
test
>
$DB_CACHE_DIR
/bok_choy_schema.sql
fi
# Load database fixtures
./manage.py lms
--settings
bok_choy loaddata
$DB_FIXTURE_DIR
/
*
.json
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