Skip to content
Permalink
Browse files

Merge branch 'develop'

  • Loading branch information
pbanaszkiewicz committed Feb 24, 2020
2 parents dfd575c + 1f14d16 commit e1b8b6f0d64336ba5ac2e9c31ff31c3bac5bb550
@@ -201,9 +201,7 @@ class NewInstructorAction(BaseAction):
"""

# It should be at least 1 hour to give admin some time in case of mistakes.
# launch_at = timedelta(hours=1)
# Shortened to 10 minutes for tests!
launch_at = timedelta(minutes=10)
launch_at = timedelta(hours=1)

@staticmethod
def check(task: Task):
@@ -288,9 +286,7 @@ class PostWorkshopAction(BaseAction):
"""

# The action should launch week after workshop's end date
# launch_at = timedelta(days=7)
# Shortened to 10 minutes for tests!
launch_at = timedelta(minutes=10)
launch_at = timedelta(days=7)

def get_launch_at(self):
event = self.context_objects.get('event', None)
@@ -406,9 +402,7 @@ class SelfOrganisedRequestAction(BaseAction):
"""

# It should be at least 1 hour to give admin some time in case of mistakes.
# launch_at = timedelta(hours=1)
# Shortened to 10 minutes for tests!
launch_at = timedelta(minutes=10)
launch_at = timedelta(hours=1)

def recipients(self):
"""Assuming self.context is ready, overwrite email's recipients
@@ -31,7 +31,7 @@ def testLaunchAt(self):
# and shouldn't pass validation
a = NewInstructorAction(trigger=Trigger(action='test-action',
template=EmailTemplate()))
self.assertEqual(a.get_launch_at(), timedelta(minutes=10))
self.assertEqual(a.get_launch_at(), timedelta(hours=1))

def testCheckConditions(self):
"""Make sure `check` works for various input data."""
@@ -48,28 +48,28 @@ def testLaunchAt(self):
a1 = PostWorkshopAction(
trigger=Trigger(action='test-action', template=EmailTemplate()),
)
self.assertEqual(a1.get_launch_at(), timedelta(minutes=10))
self.assertEqual(a1.get_launch_at(), timedelta(days=7))

# case 2: event with no end date
a2 = PostWorkshopAction(
trigger=Trigger(action='test-action', template=EmailTemplate()),
objects=dict(event=e1),
)
self.assertEqual(a2.get_launch_at(), timedelta(minutes=10))
self.assertEqual(a2.get_launch_at(), timedelta(days=7))

# case 3: event with end date
a3 = PostWorkshopAction(
trigger=Trigger(action='test-action', template=EmailTemplate()),
objects=dict(event=e2),
)
self.assertEqual(a3.get_launch_at(), timedelta(days=8, minutes=10))
self.assertEqual(a3.get_launch_at(), timedelta(days=8 + 7))

# case 4: event with negative end date
a4 = PostWorkshopAction(
trigger=Trigger(action='test-action', template=EmailTemplate()),
objects=dict(event=e3),
)
self.assertEqual(a4.get_launch_at(), timedelta(minutes=10))
self.assertEqual(a4.get_launch_at(), timedelta(days=7))

def testCheckConditions(self):
"""Make sure `check` works for various input data."""
@@ -42,7 +42,7 @@ def testLaunchAt(self):
# and shouldn't pass validation
trigger = Trigger(action='test-action', template=EmailTemplate())
a = SelfOrganisedRequestAction(trigger=trigger)
self.assertEqual(a.get_launch_at(), timedelta(minutes=10))
self.assertEqual(a.get_launch_at(), timedelta(hours=1))

def testCheckConditions(self):
"""Make sure `check` works for various input data."""
@@ -1 +1 @@
__version__ = 'v2.11.0'
__version__ = 'v2.11.1'
@@ -0,0 +1,11 @@
# AMY release v2.11.1 - 2020-02-24

A hotfix AMY release v2.11.1.


## Bugfixes
* [Piotr][] fixed wrong timestamps for Email Automation actions.
They were set up with short values for testing purposes.


[Piotr]: https://github.com/pbanaszkiewicz
@@ -1,6 +1,6 @@
{
"name": "AMY",
"version": "v2.11.0",
"version": "v2.11.1",
"description": "A web-based workshop administration application for The Carpentries",
"main": "index.js",
"repository": "git@github.com:swcarpentry/amy.git",

0 comments on commit e1b8b6f

Please sign in to comment.
You can’t perform that action at this time.