mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-21 21:53:30 +00:00
Merge pull request #531 from ae-utbm/remove_useless_tests
remove useless tests
This commit is contained in:
commit
5d97146d14
@ -170,69 +170,3 @@ class Subscription(models.Model):
|
|||||||
self.subscription_start <= date.today()
|
self.subscription_start <= date.today()
|
||||||
and date.today() <= self.subscription_end
|
and date.today() <= self.subscription_end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def guy_test(date, duration=4):
|
|
||||||
print(
|
|
||||||
str(date)
|
|
||||||
+ " - "
|
|
||||||
+ str(duration)
|
|
||||||
+ " -> "
|
|
||||||
+ str(Subscription.compute_start(date, duration))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def bibou_test(duration, date=date.today()):
|
|
||||||
print(
|
|
||||||
str(date)
|
|
||||||
+ " - "
|
|
||||||
+ str(duration)
|
|
||||||
+ " -> "
|
|
||||||
+ str(
|
|
||||||
Subscription.compute_end(
|
|
||||||
duration, Subscription.compute_start(date, duration)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def guy():
|
|
||||||
guy_test(date(2015, 7, 11))
|
|
||||||
guy_test(date(2015, 8, 11))
|
|
||||||
guy_test(date(2015, 2, 17))
|
|
||||||
guy_test(date(2015, 3, 17))
|
|
||||||
guy_test(date(2015, 1, 11))
|
|
||||||
guy_test(date(2015, 2, 11))
|
|
||||||
guy_test(date(2015, 8, 17))
|
|
||||||
guy_test(date(2015, 9, 17))
|
|
||||||
print("=" * 80)
|
|
||||||
guy_test(date(2015, 7, 11), 1)
|
|
||||||
guy_test(date(2015, 8, 11), 2)
|
|
||||||
guy_test(date(2015, 2, 17), 3)
|
|
||||||
guy_test(date(2015, 3, 17), 4)
|
|
||||||
guy_test(date(2015, 1, 11), 1)
|
|
||||||
guy_test(date(2015, 2, 11), 2)
|
|
||||||
guy_test(date(2015, 8, 17), 3)
|
|
||||||
guy_test(date(2015, 9, 17), 4)
|
|
||||||
print("=" * 80)
|
|
||||||
bibou_test(1, date(2015, 2, 18))
|
|
||||||
bibou_test(2, date(2015, 2, 18))
|
|
||||||
bibou_test(3, date(2015, 2, 18))
|
|
||||||
bibou_test(4, date(2015, 2, 18))
|
|
||||||
bibou_test(1, date(2015, 9, 18))
|
|
||||||
bibou_test(2, date(2015, 9, 18))
|
|
||||||
bibou_test(3, date(2015, 9, 18))
|
|
||||||
bibou_test(4, date(2015, 9, 18))
|
|
||||||
print("=" * 80)
|
|
||||||
bibou_test(1, date(2000, 2, 29))
|
|
||||||
bibou_test(2, date(2000, 2, 29))
|
|
||||||
bibou_test(1, date(2000, 5, 31))
|
|
||||||
bibou_test(1, date(2000, 7, 31))
|
|
||||||
bibou_test(1)
|
|
||||||
bibou_test(2)
|
|
||||||
bibou_test(3)
|
|
||||||
bibou_test(4)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
guy()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user