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
f1ceb86f
Commit
f1ceb86f
authored
Oct 26, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unneeded imports/etc from schedules management command test classes
parent
185f35b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
44 deletions
+7
-44
openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py
+5
-11
openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py
+2
-17
openedx/core/djangoapps/schedules/management/commands/tests/tools.py
+0
-16
No files found.
openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py
View file @
f1ceb86f
import
datetime
import
datetime
import
itertools
from
unittest
import
skipUnless
from
unittest
import
skipUnless
import
ddt
import
ddt
import
pytz
from
django.conf
import
settings
from
django.conf
import
settings
from
edx_ace.utils.date
import
serialize
from
edx_ace.utils.date
import
serialize
from
edx_ace.message
import
Message
from
edx_ace.message
import
Message
from
mock
import
Mock
,
patch
from
mock
import
patch
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
import
pytz
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
course_modes.tests.factories
import
CourseModeFactory
from
course_modes.tests.factories
import
CourseModeFactory
from
courseware.models
import
DynamicUpgradeDeadlineConfiguration
from
courseware.models
import
DynamicUpgradeDeadlineConfiguration
from
openedx.core.djangoapps.content.course_overviews.tests.factories
import
CourseOverviewFactory
from
openedx.core.djangoapps.schedules
import
tasks
from
openedx.core.djangoapps.schedules
import
resolvers
,
tasks
from
openedx.core.djangoapps.schedules.management.commands
import
send_recurring_nudge
as
nudge
from
openedx.core.djangoapps.schedules.management.commands
import
send_recurring_nudge
as
nudge
from
openedx.core.djangoapps.schedules.management.commands.tests.tools
import
ScheduleBaseEmailTestBase
from
openedx.core.djangoapps.schedules.management.commands.tests.tools
import
ScheduleBaseEmailTestBase
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleConfigFactory
,
ScheduleFactory
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleFactory
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteConfigurationFactory
from
openedx.core.djangolib.testing.utils
import
skip_unless_lms
from
openedx.core.djangoapps.waffle_utils.testutils
import
WAFFLE_TABLES
from
openedx.core.djangolib.testing.utils
import
CacheIsolationTestCase
,
skip_unless_lms
,
FilteredQueryCountMixin
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
...
@@ -167,5 +162,4 @@ class TestSendRecurringNudge(ScheduleBaseEmailTestBase):
...
@@ -167,5 +162,4 @@ class TestSendRecurringNudge(ScheduleBaseEmailTestBase):
def
_contains_upsell_attribute
(
self
,
msg_attr
):
def
_contains_upsell_attribute
(
self
,
msg_attr
):
msg
=
Message
.
from_string
(
msg_attr
)
msg
=
Message
.
from_string
(
msg_attr
)
tmp
=
msg
.
context
[
"show_upsell"
]
return
msg
.
context
[
"show_upsell"
]
return
msg
.
context
[
"show_upsell"
]
openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py
View file @
f1ceb86f
import
datetime
import
logging
import
logging
from
unittest
import
skipUnless
from
unittest
import
skipUnless
import
ddt
import
ddt
import
pytz
from
django.conf
import
settings
from
django.conf
import
settings
from
edx_ace
import
Message
from
edx_ace
import
Message
from
edx_ace.utils.date
import
serialize
from
edx_ace.utils.date
import
serialize
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
course_modes.tests.factories
import
CourseModeFactory
from
openedx.core.djangoapps.schedules
import
tasks
from
openedx.core.djangoapps.schedules
import
resolvers
,
tasks
from
openedx.core.djangoapps.schedules.management.commands
import
send_upgrade_reminder
as
reminder
from
openedx.core.djangoapps.schedules.management.commands
import
send_upgrade_reminder
as
reminder
from
openedx.core.djangoapps.schedules.management.commands.tests.tools
import
ScheduleBaseEmailTestBase
from
openedx.core.djangoapps.schedules.management.commands.tests.tools
import
ScheduleBaseEmailTestBase
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleConfigFactory
,
ScheduleFactory
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleFactory
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteConfigurationFactory
from
openedx.core.djangoapps.waffle_utils.testutils
import
WAFFLE_TABLES
from
openedx.core.djangolib.testing.utils
import
skip_unless_lms
from
openedx.core.djangolib.testing.utils
import
skip_unless_lms
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
...
@@ -42,15 +36,6 @@ class TestUpgradeReminder(ScheduleBaseEmailTestBase):
...
@@ -42,15 +36,6 @@ class TestUpgradeReminder(ScheduleBaseEmailTestBase):
has_course_queries
=
True
has_course_queries
=
True
def
setUp
(
self
):
super
(
TestUpgradeReminder
,
self
)
.
setUp
()
CourseModeFactory
(
course_id
=
self
.
course
.
id
,
mode_slug
=
CourseMode
.
VERIFIED
,
expiration_datetime
=
datetime
.
datetime
.
now
(
pytz
.
UTC
)
+
datetime
.
timedelta
(
days
=
30
),
)
@ddt.data
(
True
,
False
)
@ddt.data
(
True
,
False
)
@patch.object
(
tasks
,
'ace'
)
@patch.object
(
tasks
,
'ace'
)
def
test_verified_learner
(
self
,
is_verified
,
mock_ace
):
def
test_verified_learner
(
self
,
is_verified
,
mock_ace
):
...
...
openedx/core/djangoapps/schedules/management/commands/tests/tools.py
View file @
f1ceb86f
...
@@ -14,16 +14,13 @@ from edx_ace.channel import ChannelType
...
@@ -14,16 +14,13 @@ from edx_ace.channel import ChannelType
from
edx_ace.utils.date
import
serialize
from
edx_ace.utils.date
import
serialize
from
edx_ace.test_utils
import
StubPolicy
,
patch_channels
,
patch_policies
from
edx_ace.test_utils
import
StubPolicy
,
patch_channels
,
patch_policies
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteConfigurationFactory
,
SiteFactory
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteConfigurationFactory
,
SiteFactory
from
openedx.core.djangoapps.schedules
import
resolvers
,
tasks
from
openedx.core.djangoapps.schedules
import
resolvers
,
tasks
from
openedx.core.djangoapps.schedules.resolvers
import
_get_datetime_beginning_of_day
from
openedx.core.djangoapps.schedules.resolvers
import
_get_datetime_beginning_of_day
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleConfigFactory
,
ScheduleFactory
from
openedx.core.djangoapps.schedules.tests.factories
import
ScheduleConfigFactory
,
ScheduleFactory
from
openedx.core.djangoapps.waffle_utils.testutils
import
WAFFLE_TABLES
from
openedx.core.djangoapps.waffle_utils.testutils
import
WAFFLE_TABLES
from
openedx.core.djangolib.testing.utils
import
CacheIsolationTestCase
,
FilteredQueryCountMixin
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
SITE_QUERY
=
1
SITE_QUERY
=
1
...
@@ -59,19 +56,6 @@ class ScheduleBaseEmailTestBase(SharedModuleStoreTestCase):
...
@@ -59,19 +56,6 @@ class ScheduleBaseEmailTestBase(SharedModuleStoreTestCase):
has_course_queries
=
False
has_course_queries
=
False
@classmethod
def
setUpClass
(
cls
):
super
(
ScheduleBaseEmailTestBase
,
cls
)
.
setUpClass
()
cls
.
course
=
CourseFactory
.
create
(
org
=
'edX'
,
number
=
'test'
,
display_name
=
'Test Course'
,
self_paced
=
True
,
start
=
datetime
.
datetime
.
now
(
pytz
.
UTC
)
-
datetime
.
timedelta
(
days
=
30
),
)
cls
.
course_overview
=
CourseOverview
.
get_from_id
(
cls
.
course
.
id
)
def
setUp
(
self
):
def
setUp
(
self
):
super
(
ScheduleBaseEmailTestBase
,
self
)
.
setUp
()
super
(
ScheduleBaseEmailTestBase
,
self
)
.
setUp
()
...
...
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