Created
July 21, 2013 16:04
-
-
Save foxx/6048955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# default sub orders before first sub end | |
with patch_today(2013, 1, 1, 1, 1, 1) as pt: | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 0) | |
# default sub orders after first sub end | |
with patch_today(2013, 1, 6, 1, 1, 1) as pt: | |
# create | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 2) | |
self.assertEquals(len(i['subs_suspended']), 0) | |
# attempt dup | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 0) | |
self.assertEquals(len(i['subs_suspended']), 0) | |
# default sub orders during second period | |
with patch_today(2013, 1, 8, 1, 1, 1) as pt: | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 0) | |
self.assertEquals(len(i['subs_suspended']), 0) | |
# default sub orders after second period | |
with patch_today(2013, 1, 17, 1, 1, 1) as pt: | |
# create | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 1) | |
self.assertEquals(len(i['subs_suspended']), 1) | |
# attempt dup | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 0) | |
self.assertEquals(len(i['subs_suspended']), 0) | |
# default sub orders after third period | |
with patch_today(2013, 2, 10, 1, 1, 1) as pt: | |
# create | |
i = UserSubscription.objects.create_orders() | |
self.assertEquals(len(i['orders_created']), 1) | |
self.assertEquals(len(i['subs_suspended']), 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment