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
a72df1f9
Commit
a72df1f9
authored
Oct 26, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add _get_dates helper method to the schedules management command base test class
parent
346a2bcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
openedx/core/djangoapps/schedules/management/commands/tests/tools.py
+7
-0
No files found.
openedx/core/djangoapps/schedules/management/commands/tests/tools.py
View file @
a72df1f9
...
...
@@ -17,6 +17,7 @@ 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.schedules
import
resolvers
,
tasks
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.waffle_utils.testutils
import
WAFFLE_TABLES
from
openedx.core.djangolib.testing.utils
import
CacheIsolationTestCase
,
FilteredQueryCountMixin
...
...
@@ -83,6 +84,12 @@ class ScheduleBaseEmailTestBase(SharedModuleStoreTestCase):
def
_calculate_bin_for_user
(
self
,
user
):
return
user
.
id
%
self
.
tested_task
.
num_bins
def
_get_dates
(
self
,
offset
=
None
):
current_day
=
_get_datetime_beginning_of_day
(
datetime
.
datetime
.
now
(
pytz
.
UTC
))
offset
=
offset
or
self
.
expected_offsets
[
0
]
target_day
=
current_day
+
datetime
.
timedelta
(
days
=
offset
)
return
current_day
,
offset
,
target_day
def
_get_template_overrides
(
self
):
templates_override
=
deepcopy
(
settings
.
TEMPLATES
)
templates_override
[
0
][
'OPTIONS'
][
'string_if_invalid'
]
=
"TEMPLATE WARNING - MISSING VARIABLE [
%
s]"
...
...
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