mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-18 04:03:22 +00:00
remove useless tests
This commit is contained in:
parent
b8a72c57e1
commit
22b83b0814
@ -170,69 +170,3 @@ class Subscription(models.Model):
|
||||
self.subscription_start <= date.today()
|
||||
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