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
2fddd2bd
Commit
2fddd2bd
authored
Jul 22, 2016
by
Kevin Kim
Committed by
Eric Fischer
Jul 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial check of removing feature flag (#13058)
parent
b04a6a6a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
46 deletions
+31
-46
common/test/acceptance/tests/lms/test_account_settings.py
+28
-0
lms/djangoapps/student_account/test/test_views.py
+2
-26
lms/djangoapps/student_account/views.py
+0
-1
lms/envs/bok_choy.py
+0
-3
lms/envs/common.py
+0
-3
lms/static/js/spec/student_account/account_settings_factory_spec.js
+0
-1
lms/static/js/spec/student_account/helpers.js
+1
-8
lms/static/js/student_account/views/account_settings_factory.js
+0
-1
lms/static/js/student_account/views/account_settings_view.js
+0
-2
lms/static/js/views/fields.js
+0
-1
No files found.
common/test/acceptance/tests/lms/test_account_settings.py
View file @
2fddd2bd
...
@@ -7,6 +7,8 @@ from nose.plugins.attrib import attr
...
@@ -7,6 +7,8 @@ from nose.plugins.attrib import attr
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.page_object
import
XSS_INJECTION
from
bok_choy.page_object
import
XSS_INJECTION
from
datetime
import
datetime
from
pytz
import
timezone
,
utc
from
...pages.lms.account_settings
import
AccountSettingsPage
from
...pages.lms.account_settings
import
AccountSettingsPage
from
...pages.lms.auto_auth
import
AutoAuthPage
from
...pages.lms.auto_auth
import
AutoAuthPage
...
@@ -406,6 +408,32 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
...
@@ -406,6 +408,32 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
[
u'Pakistan'
,
u'Palau'
],
[
u'Pakistan'
,
u'Palau'
],
)
)
def
test_time_zone_field
(
self
):
"""
Test behaviour of "Time Zone" field
"""
kiev_abbr
,
kiev_offset
=
self
.
_get_time_zone_info
(
'Europe/Kiev'
)
pacific_abbr
,
pacific_offset
=
self
.
_get_time_zone_info
(
'US/Pacific'
)
self
.
_test_dropdown_field
(
u'time_zone'
,
u'Time Zone'
,
u''
,
[
u'Europe/Kiev ({abbr}, UTC{offset})'
.
format
(
abbr
=
kiev_abbr
,
offset
=
kiev_offset
),
u'US/Pacific ({abbr}, UTC{offset})'
.
format
(
abbr
=
pacific_abbr
,
offset
=
pacific_offset
),
],
)
def
_get_time_zone_info
(
self
,
time_zone_str
):
"""
Helper that returns current time zone abbreviation and UTC offset
and accounts for daylight savings time
"""
time_zone
=
datetime
.
now
(
utc
)
.
astimezone
(
timezone
(
time_zone_str
))
abbr
=
time_zone
.
strftime
(
'
%
Z'
)
offset
=
time_zone
.
strftime
(
'
%
z'
)
return
abbr
,
offset
def
test_preferred_language_field
(
self
):
def
test_preferred_language_field
(
self
):
"""
"""
Test behaviour of "Preferred Language" field.
Test behaviour of "Preferred Language" field.
...
...
lms/djangoapps/student_account/test/test_views.py
View file @
2fddd2bd
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
""" Tests for student account views. """
""" Tests for student account views. """
from
copy
import
copy
import
re
import
re
from
unittest
import
skipUnless
from
unittest
import
skipUnless
from
urllib
import
urlencode
from
urllib
import
urlencode
...
@@ -462,9 +461,6 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
...
@@ -462,9 +461,6 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
'password'
,
'password'
,
'year_of_birth'
,
'year_of_birth'
,
'preferred_language'
,
'preferred_language'
,
]
HIDDEN_FIELDS
=
[
'time_zone'
,
'time_zone'
,
]
]
...
@@ -512,35 +508,15 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
...
@@ -512,35 +508,15 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
self
.
assertEqual
(
context
[
'auth'
][
'providers'
][
0
][
'name'
],
'Facebook'
)
self
.
assertEqual
(
context
[
'auth'
][
'providers'
][
0
][
'name'
],
'Facebook'
)
self
.
assertEqual
(
context
[
'auth'
][
'providers'
][
1
][
'name'
],
'Google'
)
self
.
assertEqual
(
context
[
'auth'
][
'providers'
][
1
][
'name'
],
'Google'
)
def
test_hidden_fields_not_visible
(
self
):
def
test_view
(
self
):
"""
Test that hidden fields are not visible when disabled.
"""
temp_features
=
copy
(
settings
.
FEATURES
)
temp_features
[
'ENABLE_TIME_ZONE_PREFERENCE'
]
=
False
with
self
.
settings
(
FEATURES
=
temp_features
):
view_path
=
reverse
(
'account_settings'
)
response
=
self
.
client
.
get
(
path
=
view_path
)
for
attribute
in
self
.
FIELDS
:
self
.
assertIn
(
attribute
,
response
.
content
)
for
attribute
in
self
.
HIDDEN_FIELDS
:
self
.
assertIn
(
'"
%
s": {"enabled": false'
%
(
attribute
),
response
.
content
)
def
test_hidden_fields_are_visible
(
self
):
"""
"""
Test that
hidden fields are visible when enabled.
Test that
all fields are visible
"""
"""
temp_features
=
copy
(
settings
.
FEATURES
)
temp_features
[
'ENABLE_TIME_ZONE_PREFERENCE'
]
=
True
with
self
.
settings
(
FEATURES
=
temp_features
):
view_path
=
reverse
(
'account_settings'
)
view_path
=
reverse
(
'account_settings'
)
response
=
self
.
client
.
get
(
path
=
view_path
)
response
=
self
.
client
.
get
(
path
=
view_path
)
for
attribute
in
self
.
FIELDS
:
for
attribute
in
self
.
FIELDS
:
self
.
assertIn
(
attribute
,
response
.
content
)
self
.
assertIn
(
attribute
,
response
.
content
)
for
attribute
in
self
.
HIDDEN_FIELDS
:
self
.
assertIn
(
'"
%
s": {"enabled": true'
%
(
attribute
),
response
.
content
)
def
test_header_with_programs_listing_enabled
(
self
):
def
test_header_with_programs_listing_enabled
(
self
):
"""
"""
...
...
lms/djangoapps/student_account/views.py
View file @
2fddd2bd
...
@@ -454,7 +454,6 @@ def account_settings_context(request):
...
@@ -454,7 +454,6 @@ def account_settings_context(request):
'options'
:
all_languages
(),
'options'
:
all_languages
(),
},
'time_zone'
:
{
},
'time_zone'
:
{
'options'
:
TIME_ZONE_CHOICES
,
'options'
:
TIME_ZONE_CHOICES
,
'enabled'
:
settings
.
FEATURES
.
get
(
'ENABLE_TIME_ZONE_PREFERENCE'
),
}
}
},
},
'platform_name'
:
get_themed_value
(
'PLATFORM_NAME'
,
settings
.
PLATFORM_NAME
),
'platform_name'
:
get_themed_value
(
'PLATFORM_NAME'
,
settings
.
PLATFORM_NAME
),
...
...
lms/envs/bok_choy.py
View file @
2fddd2bd
...
@@ -164,9 +164,6 @@ FEATURES['ENABLE_DASHBOARD_SEARCH'] = True
...
@@ -164,9 +164,6 @@ FEATURES['ENABLE_DASHBOARD_SEARCH'] = True
# Enable support for OpenBadges accomplishments
# Enable support for OpenBadges accomplishments
FEATURES
[
'ENABLE_OPENBADGES'
]
=
True
FEATURES
[
'ENABLE_OPENBADGES'
]
=
True
# Enable time zone field in account settings. Will be removed in Ticket #TNL-4750.
FEATURES
[
'ENABLE_TIME_ZONE_PREFERENCE'
]
=
True
# Use MockSearchEngine as the search engine for test scenario
# Use MockSearchEngine as the search engine for test scenario
SEARCH_ENGINE
=
"search.tests.mock_search_engine.MockSearchEngine"
SEARCH_ENGINE
=
"search.tests.mock_search_engine.MockSearchEngine"
# Path at which to store the mock index
# Path at which to store the mock index
...
...
lms/envs/common.py
View file @
2fddd2bd
...
@@ -358,9 +358,6 @@ FEATURES = {
...
@@ -358,9 +358,6 @@ FEATURES = {
# lives in the Extended table, saving the frontend from
# lives in the Extended table, saving the frontend from
# making multiple queries.
# making multiple queries.
'ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES'
:
True
,
'ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES'
:
True
,
# WIP -- will be removed in Ticket #TNL-4750.
'ENABLE_TIME_ZONE_PREFERENCE'
:
False
,
}
}
# Ignore static asset files on import which match this pattern
# Ignore static asset files on import which match this pattern
...
...
lms/static/js/spec/student_account/account_settings_factory_spec.js
View file @
2fddd2bd
...
@@ -32,7 +32,6 @@ define(['backbone',
...
@@ -32,7 +32,6 @@ define(['backbone',
'options'
:
Helpers
.
FIELD_OPTIONS
'options'
:
Helpers
.
FIELD_OPTIONS
},
'time_zone'
:
{
},
'time_zone'
:
{
'options'
:
Helpers
.
FIELD_OPTIONS
,
'options'
:
Helpers
.
FIELD_OPTIONS
,
'enabled'
:
false
}
}
};
};
...
...
lms/static/js/spec/student_account/helpers.js
View file @
2fddd2bd
...
@@ -101,14 +101,7 @@ define(['underscore'], function(_) {
...
@@ -101,14 +101,7 @@ define(['underscore'], function(_) {
if
(
fieldsAreRendered
===
false
)
{
if
(
fieldsAreRendered
===
false
)
{
expect
(
sectionFieldElements
.
length
).
toBe
(
0
);
expect
(
sectionFieldElements
.
length
).
toBe
(
0
);
}
else
{
}
else
{
var
visible_count
=
0
;
expect
(
sectionFieldElements
.
length
).
toBe
(
sectionsData
[
sectionIndex
].
fields
.
length
);
_
.
each
(
sectionsData
[
sectionIndex
].
fields
,
function
(
field
)
{
if
(
field
.
view
.
enabled
)
{
visible_count
++
;
}
});
expect
(
sectionFieldElements
.
length
).
toBe
(
visible_count
);
_
.
each
(
sectionFieldElements
,
function
(
sectionFieldElement
,
fieldIndex
)
{
_
.
each
(
sectionFieldElements
,
function
(
sectionFieldElement
,
fieldIndex
)
{
expectElementContainsField
(
sectionFieldElement
,
sectionsData
[
sectionIndex
].
fields
[
fieldIndex
]);
expectElementContainsField
(
sectionFieldElement
,
sectionsData
[
sectionIndex
].
fields
[
fieldIndex
]);
...
...
lms/static/js/student_account/views/account_settings_factory.js
View file @
2fddd2bd
...
@@ -116,7 +116,6 @@
...
@@ -116,7 +116,6 @@
required
:
true
,
required
:
true
,
title
:
gettext
(
'Time Zone'
),
title
:
gettext
(
'Time Zone'
),
valueAttribute
:
'time_zone'
,
valueAttribute
:
'time_zone'
,
enabled
:
fieldsData
.
time_zone
.
enabled
,
helpMessage
:
gettext
(
helpMessage
:
gettext
(
'Select the time zone for displaying course dates. If you do not specify a '
+
'Select the time zone for displaying course dates. If you do not specify a '
+
'time zone here, course dates, including assignment deadlines, are displayed in '
+
'time zone here, course dates, including assignment deadlines, are displayed in '
+
...
...
lms/static/js/student_account/views/account_settings_view.js
View file @
2fddd2bd
...
@@ -68,9 +68,7 @@
...
@@ -68,9 +68,7 @@
_
.
each
(
view
.
$
(
'.account-settings-section-body'
),
function
(
sectionEl
,
index
)
{
_
.
each
(
view
.
$
(
'.account-settings-section-body'
),
function
(
sectionEl
,
index
)
{
_
.
each
(
view
.
options
.
tabSections
[
view
.
activeTab
][
index
].
fields
,
function
(
field
)
{
_
.
each
(
view
.
options
.
tabSections
[
view
.
activeTab
][
index
].
fields
,
function
(
field
)
{
if
(
field
.
view
.
enabled
)
{
$
(
sectionEl
).
append
(
field
.
view
.
render
().
el
);
$
(
sectionEl
).
append
(
field
.
view
.
render
().
el
);
}
});
});
});
});
return
this
;
return
this
;
...
...
lms/static/js/views/fields.js
View file @
2fddd2bd
...
@@ -82,7 +82,6 @@
...
@@ -82,7 +82,6 @@
this
.
helpMessage
=
this
.
options
.
helpMessage
||
''
;
this
.
helpMessage
=
this
.
options
.
helpMessage
||
''
;
this
.
showMessages
=
_
.
isUndefined
(
this
.
options
.
showMessages
)
?
true
:
this
.
options
.
showMessages
;
this
.
showMessages
=
_
.
isUndefined
(
this
.
options
.
showMessages
)
?
true
:
this
.
options
.
showMessages
;
this
.
enabled
=
_
.
isUndefined
(
this
.
options
.
enabled
)
?
true
:
this
.
options
.
enabled
;
_
.
bindAll
(
this
,
'modelValue'
,
'modelValueIsSet'
,
'showNotificationMessage'
,
'getNotificationMessage'
,
_
.
bindAll
(
this
,
'modelValue'
,
'modelValueIsSet'
,
'showNotificationMessage'
,
'getNotificationMessage'
,
'getMessage'
,
'title'
,
'showHelpMessage'
,
'showInProgressMessage'
,
'showSuccessMessage'
,
'getMessage'
,
'title'
,
'showHelpMessage'
,
'showInProgressMessage'
,
'showSuccessMessage'
,
...
...
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