Exemple #1
0
    def test_has_two_subscriptions(self):
        # not an ideal scenario, but oh well, shit happens
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 04)
        subscription.end_date = datetime.datetime(2010, 10, 13)
        user.subscriptions.add(subscription)

        subscription = Subscription()
        subscription.name = 'name1'
        subscription.start_date = datetime.datetime(2010, 10, 01)
        subscription.end_date = datetime.datetime(2010, 10, 20)
        user.subscriptions.add(subscription)

        self.assertTrue(user.has_subscription())
Exemple #2
0
    def test_has_two_subscriptions(self):
        # not an ideal scenario, but oh well, shit happens
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 04)
        subscription.end_date = datetime.datetime(2010, 10, 13)
        user.subscriptions.add(subscription)

        subscription = Subscription()
        subscription.name = 'name1'
        subscription.start_date = datetime.datetime(2010, 10, 01)
        subscription.end_date = datetime.datetime(2010, 10, 20)
        user.subscriptions.add(subscription)

        self.assertTrue(user.has_subscription())
Exemple #3
0
    def test_has_subscription(self):
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 04)
        subscription.end_date = datetime.datetime(2010, 10, 13)
        user.subscriptions.add(subscription)

        self.assertTrue(user.has_subscription())
Exemple #4
0
    def test_has_subscription(self):
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 04)
        subscription.end_date = datetime.datetime(2010, 10, 13)
        user.subscriptions.add(subscription)

        self.assertTrue(user.has_subscription())
Exemple #5
0
    def test_will_have_subscription(self):
        # subscription is on a future period
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 15)
        subscription.end_date = datetime.datetime(2010, 10, 20)
        user.subscriptions.add(subscription)

        self.assertFalse(user.has_subscription())
Exemple #6
0
    def test_will_have_subscription(self):
        # subscription is on a future period
        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 15)
        subscription.end_date = datetime.datetime(2010, 10, 20)
        user.subscriptions.add(subscription)

        self.assertFalse(user.has_subscription())
Exemple #7
0
    def test_had_subscription(self):
        # subscription is out of date

        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 01)
        subscription.end_date = datetime.datetime(2010, 10, 04)
        user.subscriptions.add(subscription)

        self.assertFalse(user.has_subscription())
Exemple #8
0
    def test_had_subscription(self):
        # subscription is out of date

        user = self.user

        subscription = Subscription()
        subscription.name = 'name'
        subscription.start_date = datetime.datetime(2010, 10, 01)
        subscription.end_date = datetime.datetime(2010, 10, 04)
        user.subscriptions.add(subscription)

        self.assertFalse(user.has_subscription())