Exemplo n.º 1
0
 def test_posted_on_sunday(self, now):
     # Unlikely to ever be posted on a Sunday, but best to check
     # anyway
     now.return_value = timezone.datetime(2016, 7, 31)  # Sunday
     order = ShippedOrderFactory()
     self.assertEqual(order.estimated_delivery_max_date(),
                      datetime.date(2016, 9, 5))
Exemplo n.º 2
0
 def test_posted_on_sunday(self, now):
     # Unlikely to ever be posted on a Sunday, but best to check
     # anyway
     now.return_value = timezone.datetime(2016, 7, 31)  # Sunday
     order = ShippedOrderFactory()
     self.assertEqual(
         order.estimated_delivery_expected_date(), datetime.date(2016, 8, 10)
     )
Exemplo n.º 3
0
    def test_pipeline_approved_list_filter__queryset_no_filter(self):
        admin = OrderOptions(OrderStatus, AdminSite())
        request = self.request_factory.get("/admin")

        list_filter = OrderStatusListFilter(request, {}, OrderStatus, admin)

        order = TestOrderFactory()
        paid = PaidOrderFactory()
        shipped = ShippedOrderFactory()

        queryset = Order.objects.all()

        self.assertIn(order, list_filter.queryset(request, queryset))
        self.assertIn(paid, list_filter.queryset(request, queryset))
        self.assertIn(shipped, list_filter.queryset(request, queryset))
Exemplo n.º 4
0
 def test_posted_on_saturday(self, now):
     now.return_value = timezone.datetime(2016, 7, 30)  # Saturday
     order = ShippedOrderFactory()
     self.assertEqual(order.estimated_delivery_max_date(), datetime.date(2016, 9, 5))
Exemplo n.º 5
0
 def test_posted_on_friday(self, now):
     now.return_value = timezone.datetime(2016, 7, 29)  # Friday
     order = ShippedOrderFactory()
     self.assertEqual(
         order.estimated_delivery_expected_date(), datetime.date(2016, 8, 10)
     )
Exemplo n.º 6
0
 def test_posted_on_monday(self, now):
     now.return_value = timezone.datetime(2016, 7, 25)  # Monday
     order = ShippedOrderFactory()
     self.assertEqual(
         order.estimated_delivery_min_date(), datetime.date(2016, 7, 26)
     )
Exemplo n.º 7
0
 def test_shipped(self):
     order = ShippedOrderFactory()
     self.assertTrue(order.shipped)
Exemplo n.º 8
0
 def test_posted_on_saturday(self, now):
     now.return_value = timezone.datetime(2016, 7, 30)  # Saturday
     order = ShippedOrderFactory()
     self.assertEqual(order.estimated_delivery_max_date(),
                      datetime.date(2016, 9, 5))
Exemplo n.º 9
0
 def test_posted_on_friday(self, now):
     now.return_value = timezone.datetime(2016, 7, 29)  # Friday
     order = ShippedOrderFactory()
     self.assertEqual(order.estimated_delivery_expected_date(),
                      datetime.date(2016, 8, 10))
Exemplo n.º 10
0
 def test_posted_on_monday(self, now):
     now.return_value = timezone.datetime(2016, 7, 25)  # Monday
     order = ShippedOrderFactory()
     self.assertEqual(order.estimated_delivery_min_date(),
                      datetime.date(2016, 7, 26))