Example #1
0
 def test_report_missing_stockrecord_raises_http404(self):
     """ Verify that Http404 is raised when no StockRecord for coupon """
     StockRecord.objects.get(product=self.coupon1).delete()
     request = RequestFactory().get('')
     response = CouponReportCSVView().get(request, self.coupon1.id)
     self.assertEqual(response.content.decode('utf-8'),
                      'Failed to find a matching stock record for coupon, report download canceled.')
     self.assertEqual(response.status_code, 404)
Example #2
0
    def request_specific_voucher_report(self, coupon):
        client = UserFactory()
        basket = Basket.get_basket(client, self.site)
        basket.add_product(coupon)

        request = RequestFactory()
        response = CouponReportCSVView().get(request, coupon_id=coupon.id)

        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.content.splitlines()), 7)
Example #3
0
PAYMENT_URLS = [
    url(r'^processors/$',
        payment_views.PaymentProcessorListView.as_view(),
        name='list_processors'),
]

REFUND_URLS = [
    url(r'^$', refund_views.RefundCreateView.as_view(), name='create'),
    url(r'^(?P<pk>[\d]+)/process/$',
        refund_views.RefundProcessView.as_view(),
        name='process'),
]

COUPON_URLS = [
    url(r'^coupon_reports/(?P<coupon_id>[\d]+)/$',
        CouponReportCSVView.as_view(),
        name='coupon_reports'),
    url(r'^categories/$',
        coupon_views.CouponCategoriesListView.as_view(),
        name='coupons_categories'),
]

CHECKOUT_URLS = [
    url(r'^$', checkout_views.CheckoutView.as_view(), name='process')
]

ATOMIC_PUBLICATION_URLS = [
    url(r'^$',
        publication_views.AtomicPublicationView.as_view(),
        name='create'),
    url(r'^{course_id}$'.format(course_id=COURSE_ID_PATTERN),
Example #4
0
        name='retrieve_order'
    ),
]

PAYMENT_URLS = [
    url(r'^processors/$', payment_views.PaymentProcessorListView.as_view(),
        name='list_processors'),
]

REFUND_URLS = [
    url(r'^$', refund_views.RefundCreateView.as_view(), name='create'),
    url(r'^(?P<pk>[\d]+)/process/$', refund_views.RefundProcessView.as_view(), name='process'),
]

COUPON_URLS = [
    url(r'^coupon_reports/(?P<coupon_id>[\d]+)/$', CouponReportCSVView.as_view(), name='coupon_reports'),
    url(r'^categories/$', coupon_views.CouponCategoriesListView.as_view(), name='coupons_categories'),
]

CHECKOUT_URLS = [
    url(r'^$', checkout_views.CheckoutView.as_view(), name='process')
]

ATOMIC_PUBLICATION_URLS = [
    url(r'^$', publication_views.AtomicPublicationView.as_view(), name='create'),
    url(
        r'^{course_id}$'.format(course_id=COURSE_ID_PATTERN),
        publication_views.AtomicPublicationView.as_view(),
        name='update'
    ),
]
Example #5
0
    def request_specific_voucher_report(self, coupon_id):
        request = RequestFactory()
        response = CouponReportCSVView().get(request, coupon_id=coupon_id)

        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.content.splitlines()), 6)
Example #6
0
PAYMENT_URLS = [
    url(r'^processors/$', payment_views.PaymentProcessorListView.as_view(), name='list_processors'),
]

REFUND_URLS = [
    url(r'^$', refund_views.RefundCreateView.as_view(), name='create'),
    url(r'^(?P<pk>[\d]+)/process/$', refund_views.RefundProcessView.as_view(), name='process'),
]

RETIREMENT_URLS = [
    url(r'^tracking_id/{}/$'.format(USERNAME_PATTERN), retirement_views.EcommerceIdView.as_view(), name='tracking_id')
]

COUPON_URLS = [
    url(r'^coupon_reports/(?P<coupon_id>[\d]+)/$', CouponReportCSVView.as_view(), name='coupon_reports'),
    url(r'^categories/$', coupon_views.CouponCategoriesListView.as_view(), name='coupons_categories'),
]

CHECKOUT_URLS = [
    url(r'^$', checkout_views.CheckoutView.as_view(), name='process')
]

ATOMIC_PUBLICATION_URLS = [
    url(r'^$', publication_views.AtomicPublicationView.as_view(), name='create'),
    url(
        r'^{course_id}$'.format(course_id=COURSE_ID_PATTERN),
        publication_views.AtomicPublicationView.as_view(),
        name='update'
    ),
]