Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
44f4e7b1
Commit
44f4e7b1
authored
11 years ago
by
Giulio Gratta
Browse files
Options
Downloads
Patches
Plain Diff
refatoring tests and added to changelog
parent
4e770988
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+3
-0
3 additions, 0 deletions
CHANGELOG.rst
lms/djangoapps/django_comment_client/tests/test_utils.py
+14
-11
14 additions, 11 deletions
lms/djangoapps/django_comment_client/tests/test_utils.py
with
17 additions
and
11 deletions
CHANGELOG.rst
+
3
−
0
View file @
44f4e7b1
...
...
@@ -5,6 +5,9 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
LMS: Added alphabetical sorting of forum categories and subcategories.
It is hidden behind a false defaulted course level flag.
Studio: Allow course authors to set their course image on the schedule
and details page, with support for JPEG and PNG images.
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/django_comment_client/tests/test_utils.py
+
14
−
11
View file @
44f4e7b1
...
...
@@ -2,7 +2,6 @@ from django.test import TestCase
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
django_comment_common.models
import
Role
,
Permission
from
factories
import
RoleFactory
from
copy
import
deepcopy
import
django_comment_client.utils
as
utils
...
...
@@ -29,8 +28,10 @@ class DictionaryTestCase(TestCase):
expected
=
{
'
cats
'
:
'
meow
'
,
'
dogs
'
:
'
woof
'
,
'
lions
'
:
'
roar
'
,
'
ducks
'
:
'
quack
'
}
self
.
assertEqual
(
utils
.
merge_dict
(
d1
,
d2
),
expected
)
def
test_sort
(
self
):
d1
=
{
class
CategorySortTestCase
(
TestCase
):
def
setUp
(
self
):
self
.
category_map
=
{
'
entries
'
:
{
u
'
General
'
:
{
'
sort_key
'
:
u
'
General
'
...
...
@@ -64,8 +65,9 @@ class DictionaryTestCase(TestCase):
}
}
}
expected_1
=
{
def
test_alpha_sort_true
(
self
):
expected_true
=
{
'
entries
'
:
{
u
'
General
'
:
{
'
sort_key
'
:
u
'
General
'
...
...
@@ -103,7 +105,11 @@ class DictionaryTestCase(TestCase):
}
}
expected_2
=
{
utils
.
sort_map_entries
(
self
.
category_map
,
True
)
self
.
assertEqual
(
self
.
category_map
,
expected_true
)
def
test_alpha_sort_false
(
self
):
expected_false
=
{
'
entries
'
:
{
u
'
General
'
:
{
'
sort_key
'
:
u
'
General
'
...
...
@@ -141,11 +147,8 @@ class DictionaryTestCase(TestCase):
}
}
d2
=
deepcopy
(
d1
)
utils
.
sort_map_entries
(
d1
,
True
)
utils
.
sort_map_entries
(
d2
,
False
)
self
.
assertEqual
(
d1
,
expected_1
)
self
.
assertEqual
(
d2
,
expected_2
)
utils
.
sort_map_entries
(
self
.
category_map
,
False
)
self
.
assertEqual
(
self
.
category_map
,
expected_false
)
class
AccessUtilsTestCase
(
TestCase
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment