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
a82489db
Commit
a82489db
authored
4 years ago
by
Matt Tuchfarber
Browse files
Options
Downloads
Patches
Plain Diff
fix tests
parent
7dd4a2b6
No related branches found
Branches containing commit
Tags
release-2020-11-19-11.03
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/programs/tasks.py
+2
-1
2 additions, 1 deletion
openedx/core/djangoapps/programs/tasks.py
openedx/core/djangoapps/programs/tests/test_signals.py
+4
-2
4 additions, 2 deletions
openedx/core/djangoapps/programs/tests/test_signals.py
with
6 additions
and
3 deletions
openedx/core/djangoapps/programs/tasks.py
+
2
−
1
View file @
a82489db
...
...
@@ -378,7 +378,8 @@ def award_course_certificate(self, username, course_run_key, certificate_availab
# Date is being passed via JSON and is encoded in the EMCA date time string format. The rest of the code
# expects a datetime.
certificate_available_date
=
datetime
.
strptime
(
certificate_available_date
,
VISIBLE_DATE_FORMAT
)
if
certificate_available_date
:
certificate_available_date
=
datetime
.
strptime
(
certificate_available_date
,
VISIBLE_DATE_FORMAT
)
# Even in the cases where this task is called with a certificate_available_date, we still need to retrieve
# the course overview because it's required to determine if we should use the certificate_available_date or
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/programs/tests/test_signals.py
+
4
−
2
View file @
a82489db
"""
This module contains tests for programs-related signals and signal handlers.
"""
import
datetime
import
mock
from
django.test
import
TestCase
from
opaque_keys.edx.keys
import
CourseKey
from
common.djangoapps.student.tests.factories
import
UserFactory
from
openedx.core.djangoapps.programs.signals
import
(
handle_course_cert_awarded
,
handle_course_cert_changed
,
...
...
@@ -20,7 +22,6 @@ from openedx.core.djangoapps.signals.signals import (
)
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteConfigurationFactory
from
openedx.core.djangolib.testing.utils
import
skip_unless_lms
from
common.djangoapps.student.tests.factories
import
UserFactory
TEST_USERNAME
=
'
test-user
'
TEST_COURSE_KEY
=
CourseKey
.
from_string
(
'
course-v1:edX+test_course+1
'
)
...
...
@@ -252,6 +253,7 @@ class CourseCertAvailableDateChangedReceiverTest(TestCase):
return
{
'
sender
'
:
self
.
__class__
,
'
course_key
'
:
TEST_COURSE_KEY
,
'
available_date
'
:
datetime
.
datetime
.
now
()
}
def
test_signal_received
(
self
,
mock_enable_update
,
mock_is_learner_issuance_enabled
,
mock_task
):
# pylint: disable=unused-argument
...
...
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