Esempio n. 1
0
    def test_wish_adding(self):
        """
        Validate we can add some items to the wishlist
        """
        product = Product.objects.get(slug='dj-rocks')
        response = self.client.get(product.get_absolute_url())
        self.assertContains(response,
                            "Django Rocks shirt",
                            count=2,
                            status_code=200)
        response = self.client.post(
            url('satchmo_smart_add'), {
                "productname": "dj-rocks",
                "1": "M",
                "2": "BL",
                "addwish": "Add to wishlist"
            })
        wishurl = url('satchmo_wishlist_view')
        self.assertRedirects(response,
                             domain + wishurl,
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(wishurl)

        self.assertContains(response,
                            "Django Rocks shirt (Medium/Blue)",
                            count=1,
                            status_code=200)
Esempio n. 2
0
    def test_wish_removing(self):
        """
        Validate that we can remove wishlist items
        """
        product = Product.objects.get(slug="dj-rocks-m-bl")
        wish = ProductWish(product=product, contact=self.contact)
        wish.save()

        product = Product.objects.get(slug="robot-attack-soft")
        wish = ProductWish(product=product, contact=self.contact)
        wish.save()

        wishurl = url('satchmo_wishlist_view')
        response = self.client.get(wishurl)
        self.assertContains(response,
                            "Robots Attack",
                            count=1,
                            status_code=200)
        self.assertContains(response,
                            "Django Rocks shirt (Medium/Blue)",
                            count=1,
                            status_code=200)

        wishurl = url('satchmo_wishlist_remove')
        response = self.client.post(wishurl, {'id': wish.id})
        self.assertContains(response,
                            "Robots Attack",
                            count=0,
                            status_code=200)
        self.assertContains(response,
                            "Django Rocks shirt (Medium/Blue)",
                            count=1,
                            status_code=200)
Esempio n. 3
0
    def test_checkout_minimums(self):
        """
        Validate we can add some items to the cart
        """
        min_order = config_get('PAYMENT', 'MINIMUM_ORDER')
        
        #start with no min.
        min_order.update("0.00")
        response = self.client.get(prefix+'/product/dj-rocks/')
        self.assertContains(response, "Django Rocks shirt", count=2, status_code=200)
        response = self.client.post(prefix+'/cart/add/', { "productname" : "dj-rocks",
                                                      "1" : "L",
                                                      "2" : "BL",
                                                      "quantity" : 2})
        self.assertRedirects(response, prefix + '/cart/',
            status_code=302, target_status_code=200)
        response = self.client.get(prefix+'/cart/')
        self.assertContains(response, "Django Rocks shirt (Large/Blue)", count=1, status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Information", count=1, status_code=200)

        # now check for min order not met
        min_order.update("100.00")
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "This store requires a minimum order", count=1, status_code=200)
        
        # add a bunch of shirts, to make the min order
        response = self.client.post(prefix+'/cart/add/', { "productname" : "dj-rocks",
                                                      "1" : "L",
                                                      "2" : "BL",
                                                      "quantity" : 10})
        self.assertRedirects(response, prefix + '/cart/',
            status_code=302, target_status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Information", count=1, status_code=200)
Esempio n. 4
0
 def testQuickOrderAdd(self):
     """Test adding multiple products at once to cart."""
     response = self.client.get(url('satchmo_quick_order'))
     self.assertContains(response,
                         "Django Rocks shirt (Large/Black)",
                         status_code=200)
     self.assertContains(response, "Python Rocks shirt", status_code=200)
     response = self.client.post(url('satchmo_quick_order'), {
         "qty__dj-rocks-l-b": "2",
         "qty__PY-Rocks": "1",
     })
     #print response
     self.assertRedirects(response,
                          url('satchmo_cart'),
                          status_code=302,
                          target_status_code=200)
     response = self.client.get(prefix + '/cart/')
     self.assertContains(response,
                         "Django Rocks shirt (Large/Black)",
                         status_code=200)
     self.assertContains(response, "Python Rocks shirt")
     cart = Cart.objects.latest('id')
     self.assertEqual(cart.numItems, 3)
     products = [(item.product.slug, item.quantity)
                 for item in cart.cartitem_set.all()]
     products.sort()
     self.assertEqual(len(products), 2)
     self.assertEqual(products[0][0], 'PY-Rocks')
     self.assertEqual(products[0][1], Decimal(1))
     self.assertEqual(products[1][0], 'dj-rocks-l-b')
     self.assertEqual(products[1][1], Decimal(2))
Esempio n. 5
0
    def test_checkout_minimums(self):
        """
        Validate we can add some items to the cart
        """
        min_order = config_get("PAYMENT", "MINIMUM_ORDER")

        # start with no min.
        min_order.update("0.00")
        producturl = urlresolvers.reverse("satchmo_product", kwargs={"product_slug": "dj-rocks"})
        response = self.client.get(producturl)
        self.assertContains(response, "Django Rocks shirt", count=2, status_code=200)
        cartadd = urlresolvers.reverse("satchmo_cart_add")
        response = self.client.post(cartadd, {"productname": "dj-rocks", "1": "L", "2": "BL", "quantity": "2"})
        carturl = urlresolvers.reverse("satchmo_cart")
        self.assertRedirects(response, carturl, status_code=302, target_status_code=200)
        response = self.client.get(carturl)
        self.assertContains(response, "Django Rocks shirt (Large/Blue)", count=1, status_code=200)
        response = self.client.get(url("satchmo_checkout-step1"))
        self.assertContains(response, "Billing Information", count=1, status_code=200)

        # now check for min order not met
        min_order.update("100.00")
        response = self.client.get(url("satchmo_checkout-step1"))
        self.assertContains(response, "This store requires a minimum order", count=1, status_code=200)

        # add a bunch of shirts, to make the min order
        response = self.client.post(cartadd, {"productname": "dj-rocks", "1": "L", "2": "BL", "quantity": "10"})
        self.assertRedirects(response, carturl, status_code=302, target_status_code=200)
        response = self.client.get(url("satchmo_checkout-step1"))
        self.assertContains(response, "Billing Information", count=1, status_code=200)
Esempio n. 6
0
File: tests.py Progetto: 34/T
    def test_wish_to_cart(self):
        """
        Validate that we can move an item to the cart
        """
        product = Product.objects.get(slug="dj-rocks-m-bl")
        wish = ProductWish(product = product, contact=self.contact)
        wish.save()
        
        product = Product.objects.get(slug="robot-attack-soft")
        wish = ProductWish(product = product, contact=self.contact)
        wish.save()
        
        wishurl = url('satchmo_wishlist_view')
        response = self.client.get(wishurl)
        self.assertContains(response, "Robots Attack", count=1, status_code=200)
        self.assertContains(response, "Django Rocks shirt (Medium/Blue)", count=1, status_code=200)
        
        moveurl = url('satchmo_wishlist_move_to_cart')
        response = self.client.post(moveurl, {
            'id' : wish.id
        })
        carturl = url('satchmo_cart')
        self.assertRedirects(response, domain + carturl, status_code=302, target_status_code=200)

        response = self.client.get(carturl)
        self.assertContains(response, "Robots Attack", count=1, status_code=200)
        
        
Esempio n. 7
0
    def test_checkout_minimums(self):
        """
        Validate we can add some items to the cart
        """
        min_order = config_get('PAYMENT', 'MINIMUM_ORDER')

        #start with no min.
        min_order.update("0.00")
        response = self.client.get(prefix + '/product/dj-rocks/')
        self.assertContains(response,
                            "Django Rocks shirt",
                            count=2,
                            status_code=200)
        response = self.client.post(prefix + '/cart/add/', {
            "productname": "dj-rocks",
            "1": "L",
            "2": "BL",
            "quantity": 2
        })
        self.assertRedirects(response,
                             prefix + '/cart/',
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(prefix + '/cart/')
        self.assertContains(response,
                            "Django Rocks shirt (Large/Blue)",
                            count=2,
                            status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Address", status_code=200)

        # now check for min order not met
        min_order.update("100.00")
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response,
                            "This store requires a minimum order",
                            count=1,
                            status_code=200)

        # add a bunch of shirts, to make the min order
        response = self.client.post(prefix + '/cart/add/', {
            "productname": "dj-rocks",
            "1": "L",
            "2": "BL",
            "quantity": 10
        })
        self.assertRedirects(response,
                             prefix + '/cart/',
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Address", status_code=200)
def assigner_disciplines(request, app_name, model_name):
    ids = request.GET.get("ids").split(",")
    model = get_model(app_name, model_name)
    objects = model.objects.filter(pk__in=ids)
    if request.method == 'POST':
        disciplines_form = DisciplinesForm(request.POST)

        if disciplines_form.is_valid():
            disciplines = disciplines_form.cleaned_data['disciplines']
            for o in objects:
                o.assigner_disciplines(disciplines)
                o.save()
            
            # retouner un status à l'utilisateur sur la liste des références
            disciplines_noms = u", ".join([p.nom for p in disciplines])
            messages.success(
                request,
                u"Les disciplines %s ont été assignées à %s objets" %
                (disciplines_noms, len(ids))
            )
            return HttpResponseRedirect(url('admin:%s_%s_changelist' % (app_name, model_name)))
    else:
        disciplines_form = DisciplinesForm()

    return render_to_response(
        "savoirs/assigner.html",
        dict(objects=objects,
             form=disciplines_form,
             titre=u"Assignation de disciplines par lots",
             description=u"Sélectionner les disciplines qui seront associées aux références suivantes :"),
        context_instance = RequestContext(request)
    )
Esempio n. 9
0
 def assigner_disciplines(self, request, queryset):
     selected = queryset.values_list('id', flat=True)
     selected = ",".join("%s" % val for val in selected)
     return HttpResponseRedirect(url(
         'assigner_disciplines',
         kwargs={'app_name': 'savoirs', 'model_name': 'evenement'}
     ) + '?ids=' + selected)
Esempio n. 10
0
def password_change(request,
                    template_name='registration/password_change_form.html',
                    post_change_redirect=None,
                    password_change_form=PasswordChangeForm):
    if post_change_redirect is None:
        post_change_redirect = url(
            'django.contrib.auth.views.password_change_done'
        )
    if request.method == "POST":
        form = password_change_form(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()

            # Mot de passe pour LDAP
            username = request.user.email
            authldap, created = \
                    AuthLDAP.objects.get_or_create(username=username)
            password = form.cleaned_data.get('new_password1')
            authldap.ldap_hash = create_ldap_hash(password)
            authldap.save()

            return redirect(post_change_redirect)
    else:
        form = password_change_form(user=request.user)
    return render(request, template_name, {'form': form})
Esempio n. 11
0
File: tests.py Progetto: 34/T
 def test_wish_adding(self):
     """
     Validate we can add some items to the wishlist
     """
     product = Product.objects.get(slug='dj-rocks')
     response = self.client.get(product.get_absolute_url())
     self.assertContains(response, "Django Rocks shirt", count=2, status_code=200)
     response = self.client.post(url('satchmo_smart_add'), { 
         "productname" : "dj-rocks",
         "1" : "M",
         "2" : "BL",
         "addwish" : "Add to wishlist"
     })
     wishurl = url('satchmo_wishlist_view')
     self.assertRedirects(response, domain + wishurl, status_code=302, target_status_code=200)
     response = self.client.get(wishurl)
     
     self.assertContains(response, "Django Rocks shirt (Medium/Blue)", count=1, status_code=200)
Esempio n. 12
0
File: tests.py Progetto: 34/T
    def test_main_page(self):
        """
        Look at the main page
        """
        response = self.client.get(url('satchmo_shop_home'))

        # Check that the rendered context contains 4 products
        self.assertContains(response, '<div class = "productImage">',
                            count=4, status_code=200)
Esempio n. 13
0
 def test_contact_login(self):
     """Check that when a user logs in, the user's existing Contact will be
     used.
     """
     user = User.objects.create_user("teddy", "*****@*****.**", "guz90tyc")
     contact = Contact.objects.create(user=user, first_name="Teddy", last_name="Tester")
     self.client.login(username="******", password="******")
     self.test_cart_adding()
     response = self.client.get(url("satchmo_checkout-step1"))
     self.assertContains(response, "Teddy", status_code=200)
Esempio n. 14
0
    def test_custom_product(self):
        """
        Verify that the custom product is working as expected.
        """
        pm = config_get("PRODUCT", "PRODUCT_TYPES")
        pm.update(
            [
                "product::ConfigurableProduct",
                "product::ProductVariation",
                "product::CustomProduct",
                "product::SubscriptionProduct",
            ]
        )

        response = self.client.get(prefix + "/")
        self.assertContains(response, "Computer", count=1)
        response = self.client.get(prefix + "/product/satchmo-computer/")
        self.assertContains(response, "Memory", count=1)
        self.assertContains(response, "Case", count=1)
        self.assertContains(response, "Monogram", count=1)
        response = self.client.post(
            prefix + "/cart/add/",
            {"productname": "satchmo-computer", "5": "1.5gb", "6": "mid", "custom_monogram": "CBM", "quantity": 1},
        )
        self.assertRedirects(response, prefix + "/cart/", status_code=302, target_status_code=200)
        response = self.client.get(prefix + "/cart/")
        self.assertContains(response, '/satchmo-computer/">satchmo computer', count=1, status_code=200)
        self.assertContains(response, smart_str("%s168.00" % config_value("SHOP", "CURRENCY")), count=3)
        self.assertContains(response, smart_str("Monogram: CBM  %s10.00" % config_value("SHOP", "CURRENCY")), count=1)
        self.assertContains(
            response, smart_str("Case - External Case: Mid  %s10.00" % config_value("SHOP", "CURRENCY")), count=1
        )
        self.assertContains(
            response, smart_str("Memory - Internal RAM: 1.5 GB  %s25.00" % config_value("SHOP", "CURRENCY")), count=1
        )
        response = self.client.post(url("satchmo_checkout-step1"), get_step1_post_data(self.US))
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step2"), status_code=302, target_status_code=200)
        data = {
            "credit_type": "Visa",
            "credit_number": "4485079141095836",
            "month_expires": "1",
            "year_expires": "2012",
            "ccv": "552",
            "shipping": "FlatRate",
        }
        response = self.client.post(url("DUMMY_satchmo_checkout-step2"), data)
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step3"), status_code=302, target_status_code=200)
        response = self.client.get(url("DUMMY_satchmo_checkout-step3"))
        self.assertContains(
            response,
            smart_str("satchmo computer - %s168.00" % config_value("SHOP", "CURRENCY")),
            count=1,
            status_code=200,
        )
        response = self.client.post(url("DUMMY_satchmo_checkout-step3"), {"process": "True"})
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-success"), status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)
Esempio n. 15
0
    def test_main_page(self):
        """
        Look at the main page
        """
        response = self.client.get(url('satchmo_shop_home'))

        # Check that the rendered context contains 4 products
        self.assertContains(response,
                            '<div class = "productImage">',
                            count=4,
                            status_code=200)
Esempio n. 16
0
 def remove_from_group(self, request, queryset):
     groupe_id = request.GET.get('groupes__id__exact')
     chercheur_ids = queryset.values_list('id', flat=True)
     matches = AdhesionGroupe.objects.filter(
         groupe=groupe_id, chercheur__in=chercheur_ids
     )
     matches.delete()
     return HttpResponseRedirect(
         url('admin:chercheurs_chercheur_changelist') +
         '?groupes__id__exact=' + groupe_id
     )
Esempio n. 17
0
 def testQuickOrderAdd(self):
     """Test adding multiple products at once to cart."""
     response = self.client.get(url("satchmo_quick_order"))
     self.assertContains(response, "Django Rocks shirt (Large/Black)", status_code=200)
     self.assertContains(response, "Python Rocks shirt", status_code=200)
     response = self.client.post(url("satchmo_quick_order"), {"qty__dj-rocks-l-b": "2", "qty__PY-Rocks": "1"})
     print response
     self.assertRedirects(response, url("satchmo_cart"), status_code=302, target_status_code=200)
     response = self.client.get(prefix + "/cart/")
     self.assertContains(response, "Django Rocks shirt (Large/Black)", status_code=200)
     self.assertContains(response, "Python Rocks shirt")
     cart = Cart.objects.latest("id")
     self.assertEqual(cart.numItems, 3)
     products = [(item.product.slug, item.quantity) for item in cart.cartitem_set.all()]
     products.sort()
     self.assertEqual(len(products), 2)
     self.assertEqual(products[0][0], "PY-Rocks")
     self.assertEqual(products[0][1], Decimal(1))
     self.assertEqual(products[1][0], "dj-rocks-l-b")
     self.assertEqual(products[1][1], Decimal(2))
Esempio n. 18
0
 def test_contact_login(self):
     """Check that when a user logs in, the user's existing Contact will be
     used.
     """
     user = User.objects.create_user('teddy', '*****@*****.**', 'guz90tyc')
     contact = Contact.objects.create(user=user, first_name="Teddy",
         last_name="Tester")
     self.client.login(username='******', password='******')
     self.test_cart_adding()
     response = self.client.get(url('satchmo_checkout-step1'))
     self.assertContains(response, "Teddy", status_code=200)
Esempio n. 19
0
    def test_checkout(self):
        """
        Run through a full checkout process
        """
        cache_delete()
        tax = config_get('TAX','MODULE')
        tax.update('tax.modules.percent')
        pcnt = config_get('TAX', 'PERCENT')
        pcnt.update('10')
        shp = config_get('TAX', 'TAX_SHIPPING')
        shp.update(False)

        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2014',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)

        # Log in as a superuser
        user = User.objects.create_user('fredsu', '*****@*****.**', 'passwd')
        user.is_staff = True
        user.is_superuser = True
        user.save()
        self.client.login(username='******', password='******')

        # Test pdf generation
        order_id = Order.objects.all()[0].id
        response = self.client.get('/admin/print/invoice/%d/' % order_id)
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/packingslip/%d/' % order_id)
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/shippinglabel/%d/' % order_id)
        self.assertContains(response, 'reportlab', status_code=200)
Esempio n. 20
0
    def test_checkout(self):
        """
        Run through a full checkout process
        """
        cache_delete()
        tax = config_get('TAX','MODULE')
        tax.update('tax.modules.percent')
        pcnt = config_get('TAX', 'PERCENT')
        pcnt.update('10')
        shp = config_get('TAX', 'TAX_SHIPPING')
        shp.update(False)

        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2015',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)

        # Log in as a superuser
        user = User.objects.create_user('fredsu', '*****@*****.**', 'passwd')
        user.is_staff = True
        user.is_superuser = True
        user.save()
        self.client.login(username='******', password='******')

        # Test invoice, packing slip and shipping label generation
        order_id = Order.objects.all()[0].id
        response = self.client.get('/admin/print/invoice/%d/' % order_id)
        self.assertEqual(response.status_code, 200)
        response = self.client.get('/admin/print/packingslip/%d/' % order_id)
        self.assertEqual(response.status_code, 200)
        response = self.client.get('/admin/print/shippinglabel/%d/' % order_id)
        self.assertEqual(response.status_code, 200)
Esempio n. 21
0
    def test_checkout(self):
        """
        Run through a full checkout process
        """
        cache_delete()
        tax = config_get("TAX", "MODULE")
        tax.update("tax.modules.percent")
        pcnt = config_get("TAX", "PERCENT")
        pcnt.update("10")
        shp = config_get("TAX", "TAX_SHIPPING")
        shp.update(False)

        self.test_cart_adding()
        response = self.client.post(url("satchmo_checkout-step1"), get_step1_post_data(self.US))
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step2"), status_code=302, target_status_code=200)
        data = {
            "credit_type": "Visa",
            "credit_number": "4485079141095836",
            "month_expires": "1",
            "year_expires": "2014",
            "ccv": "552",
            "shipping": "FlatRate",
        }
        response = self.client.post(url("DUMMY_satchmo_checkout-step2"), data)
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step3"), status_code=302, target_status_code=200)
        response = self.client.get(url("DUMMY_satchmo_checkout-step3"))
        amount = smart_str("Shipping + " + moneyfmt(Decimal("4.00")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Tax + " + moneyfmt(Decimal("4.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Total = " + moneyfmt(Decimal("54.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url("DUMMY_satchmo_checkout-step3"), {"process": "True"})
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-success"), status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)

        # Log in as a superuser
        user = User.objects.create_user("fredsu", "*****@*****.**", "passwd")
        user.is_staff = True
        user.is_superuser = True
        user.save()
        self.client.login(username="******", password="******")

        # Test pdf generation
        order_id = Order.objects.all()[0].id
        response = self.client.get("/admin/print/invoice/%d/" % order_id)
        self.assertContains(response, "reportlab", status_code=200)
        response = self.client.get("/admin/print/packingslip/%d/" % order_id)
        self.assertContains(response, "reportlab", status_code=200)
        response = self.client.get("/admin/print/shippinglabel/%d/" % order_id)
        self.assertContains(response, "reportlab", status_code=200)
Esempio n. 22
0
    def test_checkout_minimums(self):
        """
        Validate we can add some items to the cart
        """
        min_order = config_get('PAYMENT', 'MINIMUM_ORDER')

        #start with no min.
        min_order.update("0.00")
        producturl = urlresolvers.reverse("satchmo_product", kwargs={'product_slug' : 'dj-rocks'})
        response = self.client.get(producturl)
        self.assertContains(response, "Django Rocks shirt", count=2, status_code=200)
        cartadd = urlresolvers.reverse('satchmo_cart_add')
        response = self.client.post(cartadd, { "productname" : "dj-rocks",
                                                      "1" : "L",
                                                      "2" : "BL",
                                                      "quantity" : '2'})
        carturl = urlresolvers.reverse('satchmo_cart')
        self.assertRedirects(response, carturl,
            status_code=302, target_status_code=200)
        response = self.client.get(carturl)
        self.assertContains(response, "Django Rocks shirt (Large/Blue)", count=1, status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Information", count=1, status_code=200)

        # now check for min order not met
        min_order.update("100.00")
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "This store requires a minimum order", count=1, status_code=200)

        # add a bunch of shirts, to make the min order
        response = self.client.post(cartadd, { "productname" : "dj-rocks",
                                                      "1" : "L",
                                                      "2" : "BL",
                                                      "quantity" : '10'})
        self.assertRedirects(response, carturl,
            status_code=302, target_status_code=200)
        response = self.client.get(url('satchmo_checkout-step1'))
        self.assertContains(response, "Billing Information", count=1, status_code=200)
Esempio n. 23
0
File: tests.py Progetto: 34/T
 def test_wish_removing(self):
     """
     Validate that we can remove wishlist items
     """
     product = Product.objects.get(slug="dj-rocks-m-bl")
     wish = ProductWish(product = product, contact=self.contact)
     wish.save()
     
     product = Product.objects.get(slug="robot-attack-soft")
     wish = ProductWish(product = product, contact=self.contact)
     wish.save()
     
     wishurl = url('satchmo_wishlist_view')
     response = self.client.get(wishurl)
     self.assertContains(response, "Robots Attack", count=1, status_code=200)
     self.assertContains(response, "Django Rocks shirt (Medium/Blue)", count=1, status_code=200)
     
     wishurl = url('satchmo_wishlist_remove')
     response = self.client.post(wishurl, {
         'id' : wish.id
     })
     self.assertContains(response, "Robots Attack", count=0, status_code=200)
     self.assertContains(response, "Django Rocks shirt (Medium/Blue)", count=1, status_code=200)
Esempio n. 24
0
File: tests.py Progetto: 34/T
 def test_wish_adding_not_logged_in(self):
     """
     Validate we can't add unless we are logged in.
     """
     product = Product.objects.get(slug='dj-rocks')
     response = self.client.get(product.get_absolute_url())
     self.assertContains(response, "Django Rocks shirt", count=2, status_code=200)
     response = self.client.post(url('satchmo_smart_add'), { 
         "productname" : "dj-rocks",
         "1" : "M",
         "2" : "BL",
         "addwish" : "Add to wishlist"
     })
     self.assertContains(response, "Sorry, you must be", count=1, status_code=200)
Esempio n. 25
0
    def test_custom_product(self):
        """
        Verify that the custom product is working as expected.
        """
        response = self.client.get(prefix+"/")
        self.assertContains(response, "Computer", count=1)
        response = self.client.get(prefix+"/product/satchmo-computer/")
        self.assertContains(response, "Memory", count=1)
        self.assertContains(response, "Case", count=1)
        self.assertContains(response, "Monogram", count=1)
        response = self.client.post(prefix+'/cart/add/', { "productname" : "satchmo-computer",
                                                      "5" : "1.5gb",
                                                      "6" : "mid",
                                                      "custom_monogram": "CBM",
                                                      "quantity" : '1'})
        self.assertRedirects(response, prefix + '/cart/',
            status_code=302, target_status_code=200)
        response = self.client.get(prefix+'/cart/')
        self.assertContains(response, '/satchmo-computer/">satchmo computer', count=1, status_code=200)
        amount = smart_str(moneyfmt(Decimal('168.00')))
        self.assertContains(response, amount, count=4)

        amount = smart_str('Monogram: CBM  ' + moneyfmt(Decimal('10.00')))
        self.assertContains(response, amount, count=1)

        amount = smart_str('Case - External Case: Mid  ' + moneyfmt(Decimal('10.00')))
        self.assertContains(response, amount, count=1)

        amount = smart_str('Memory - Internal RAM: 1.5 GB  ' + moneyfmt(Decimal('25.00')))
        self.assertContains(response, amount, count=1)

        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2012',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))

        amount = smart_str('satchmo computer - ' + moneyfmt(Decimal('168.00')))
        self.assertContains(response, amount, count=1, status_code=200)
        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)
Esempio n. 26
0
    def test_wish_to_cart(self):
        """
        Validate that we can move an item to the cart
        """
        product = Product.objects.get(slug="dj-rocks-m-bl")
        wish = ProductWish(product=product, contact=self.contact)
        wish.save()

        product = Product.objects.get(slug="robot-attack-soft")
        wish = ProductWish(product=product, contact=self.contact)
        wish.save()

        wishurl = url('satchmo_wishlist_view')
        response = self.client.get(wishurl)
        self.assertContains(response,
                            "Robots Attack",
                            count=1,
                            status_code=200)
        self.assertContains(response,
                            "Django Rocks shirt (Medium/Blue)",
                            count=1,
                            status_code=200)

        moveurl = url('satchmo_wishlist_move_to_cart')
        response = self.client.post(moveurl, {'id': wish.id})
        carturl = url('satchmo_cart')
        self.assertRedirects(response,
                             domain + carturl,
                             status_code=302,
                             target_status_code=200)

        response = self.client.get(carturl)
        self.assertContains(response,
                            "Robots Attack",
                            count=1,
                            status_code=200)
Esempio n. 27
0
 def test_wish_adding_not_logged_in(self):
     """
     Validate we can't add unless we are logged in.
     """
     product = Product.objects.get(slug='dj-rocks')
     response = self.client.get(product.get_absolute_url())
     self.assertContains(response,
                         "Django Rocks shirt",
                         count=2,
                         status_code=200)
     response = self.client.post(
         url('satchmo_smart_add'), {
             "productname": "dj-rocks",
             "1": "M",
             "2": "BL",
             "addwish": "Add to wishlist"
         })
     self.assertContains(response,
                         "Sorry, you must be",
                         count=1,
                         status_code=200)
Esempio n. 28
0
    def test_checkout(self):
        """
        Run through a full checkout process
        """
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), checkout_step1_post_data)
        self.assertRedirects(response, domain + url('DUMMY_satchmo_checkout-step2'), status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2009',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, domain + url('DUMMY_satchmo_checkout-step3'), status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        self.assertContains(response, smart_str("Shipping + %s4.00" % config_value('SHOP', 'CURRENCY')), count=1, status_code=200)
        self.assertContains(response, smart_str("Tax + %s4.60" % config_value('SHOP', 'CURRENCY')), count=1, status_code=200)
        self.assertContains(response, smart_str("Total = %s54.60" % config_value('SHOP', 'CURRENCY')), count=1, status_code=200)
        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, domain + url('DUMMY_satchmo_checkout-success'), status_code=302, target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)

        # Log in as a superuser
        user = User.objects.create_user('fredsu', '*****@*****.**', 'passwd')
        user.is_staff = True
        user.is_superuser = True
        user.save()
        self.client.login(username='******', password='******')

        # Test pdf generation
        response = self.client.get('/admin/print/invoice/1/')
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/packingslip/1/')
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/shippinglabel/1/')
        self.assertContains(response, 'reportlab', status_code=200)
Esempio n. 29
0
 def assigner_disciplines(self, request, queryset):
     selected = request.POST.getlist(admin.ACTION_CHECKBOX_NAME)
     return HttpResponseRedirect(url('assigner_disciplines', kwargs=dict(app_name='sitotheque', model_name='site')) + '?ids=' + ','.join(selected))
Esempio n. 30
0
    def test_two_checkouts_dont_duplicate_contact(self):
        """
        Two checkouts with the same email address do not duplicate contacts
        Ticket #1264 [Invalid]
        """

        tax = config_get('TAX','MODULE')
        tax.update('tax.modules.percent')
        pcnt = config_get('TAX', 'PERCENT')
        pcnt.update('10')
        shp = config_get('TAX', 'TAX_SHIPPING')
        shp.update(False)

        # First checkout
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2015',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)

        # Second checkout
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2015',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)

        self.assertEqual(len(mail.outbox), 2)

        qs = Contact.objects.filter(email="*****@*****.**")
        # We expects that the contact do not duplicate
        self.assertEqual(len(qs), 1)
 def change_url(self, object):
     """Retourne l'url pour éditer le record"""
     return url('admin:%s_%s_change' %(object._meta.app_label, object._meta.module_name), args=[object.id])
Esempio n. 32
0
    def test_custom_product(self):
        """
        Verify that the custom product is working as expected.
        """
        pm = config_get("PRODUCT", "PRODUCT_TYPES")
        pm.update([
            "product::ConfigurableProduct", "product::ProductVariation",
            "product::CustomProduct", "product::SubscriptionProduct"
        ])

        response = self.client.get(prefix + "/")
        self.assertContains(response, "Computer", count=1)
        response = self.client.get(prefix + "/product/satchmo-computer/")
        self.assertContains(response, "Memory", count=1)
        self.assertContains(response, "Case", count=1)
        self.assertContains(response, "Monogram", count=1)
        response = self.client.post(
            prefix + '/cart/add/', {
                "productname": "satchmo-computer",
                "5": "1.5gb",
                "6": "mid",
                "custom_monogram": "CBM",
                "quantity": 1
            })
        self.assertRedirects(response,
                             prefix + '/cart/',
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(prefix + '/cart/')
        self.assertContains(response,
                            '/satchmo-computer/">satchmo computer',
                            status_code=200)
        self.assertContains(response,
                            smart_str("%s168.00" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=4)
        self.assertContains(response,
                            smart_str("Monogram: CBM  %s10.00" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1)
        self.assertContains(response,
                            smart_str("Case - External Case: Mid  %s10.00" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1)
        self.assertContains(
            response,
            smart_str("Memory - Internal RAM: 1.5 GB  %s25.00" %
                      config_value('SHOP', 'CURRENCY')),
            count=1)
        response = self.client.post(url('satchmo_checkout-step1'),
                                    get_step1_post_data(self.US))
        self.assertRedirects(response,
                             url('DUMMY_satchmo_checkout-step2'),
                             status_code=302,
                             target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2012',
            'ccv': '552',
            'shipping': 'FlatRate'
        }
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response,
                             url('DUMMY_satchmo_checkout-step3'),
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        self.assertContains(response,
                            smart_str("satchmo computer - %s168.00" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1,
                            status_code=200)
        response = self.client.post(url('DUMMY_satchmo_checkout-step3'),
                                    {'process': 'True'})
        self.assertRedirects(response,
                             url('DUMMY_satchmo_checkout-success'),
                             status_code=302,
                             target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)
Esempio n. 33
0
    def test_two_checkouts_dont_duplicate_contact(self):
        """
        Two checkouts with the same email address do not duplicate contacts
        Ticket #1264 [Invalid]
        """

        tax = config_get("TAX", "MODULE")
        tax.update("tax.modules.percent")
        pcnt = config_get("TAX", "PERCENT")
        pcnt.update("10")
        shp = config_get("TAX", "TAX_SHIPPING")
        shp.update(False)

        # First checkout
        self.test_cart_adding()
        response = self.client.post(url("satchmo_checkout-step1"), get_step1_post_data(self.US))
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step2"), status_code=302, target_status_code=200)
        data = {
            "credit_type": "Visa",
            "credit_number": "4485079141095836",
            "month_expires": "1",
            "year_expires": "2014",
            "ccv": "552",
            "shipping": "FlatRate",
        }
        response = self.client.post(url("DUMMY_satchmo_checkout-step2"), data)
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step3"), status_code=302, target_status_code=200)
        response = self.client.get(url("DUMMY_satchmo_checkout-step3"))
        amount = smart_str("Shipping + " + moneyfmt(Decimal("4.00")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Tax + " + moneyfmt(Decimal("4.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Total = " + moneyfmt(Decimal("54.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url("DUMMY_satchmo_checkout-step3"), {"process": "True"})
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-success"), status_code=302, target_status_code=200)

        # Second checkout
        self.test_cart_adding()
        response = self.client.post(url("satchmo_checkout-step1"), get_step1_post_data(self.US))
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step2"), status_code=302, target_status_code=200)
        data = {
            "credit_type": "Visa",
            "credit_number": "4485079141095836",
            "month_expires": "1",
            "year_expires": "2014",
            "ccv": "552",
            "shipping": "FlatRate",
        }
        response = self.client.post(url("DUMMY_satchmo_checkout-step2"), data)
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-step3"), status_code=302, target_status_code=200)
        response = self.client.get(url("DUMMY_satchmo_checkout-step3"))
        amount = smart_str("Shipping + " + moneyfmt(Decimal("4.00")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Tax + " + moneyfmt(Decimal("4.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str("Total = " + moneyfmt(Decimal("54.60")))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url("DUMMY_satchmo_checkout-step3"), {"process": "True"})
        self.assertRedirects(response, url("DUMMY_satchmo_checkout-success"), status_code=302, target_status_code=200)

        self.assertEqual(len(mail.outbox), 2)

        qs = Contact.objects.filter(email="*****@*****.**")
        # We expects that the contact do not duplicate
        self.assertEqual(len(qs), 1)
Esempio n. 34
0
    def test_two_checkouts_dont_duplicate_contact(self):
        """
        Two checkouts with the same email address do not duplicate contacts
        Ticket #1264 [Invalid]
        """

        tax = config_get('TAX','MODULE')
        tax.update('tax.modules.percent')
        pcnt = config_get('TAX', 'PERCENT')
        pcnt.update('10')
        shp = config_get('TAX', 'TAX_SHIPPING')
        shp.update(False)

        # First checkout
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2014',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)

        # Second checkout
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'), get_step1_post_data(self.US))
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step2'),
            status_code=302, target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2014',
            'ccv': '552',
            'shipping': 'FlatRate'}
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-step3'),
            status_code=302, target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        amount = smart_str('Shipping + ' + moneyfmt(Decimal('4.00')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Tax + ' + moneyfmt(Decimal('4.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        amount = smart_str('Total = ' + moneyfmt(Decimal('54.60')))
        self.assertContains(response, amount, count=1, status_code=200)

        response = self.client.post(url('DUMMY_satchmo_checkout-step3'), {'process' : 'True'})
        self.assertRedirects(response, url('DUMMY_satchmo_checkout-success'),
            status_code=302, target_status_code=200)

        self.assertEqual(len(mail.outbox), 2)

        qs = Contact.objects.filter(email="*****@*****.**")
        # We expects that the contact do not duplicate
        self.assertEqual(len(qs), 1)
Esempio n. 35
0
    def test_checkout(self):
        """
        Run through a full checkout process
        """
        self.test_cart_adding()
        response = self.client.post(url('satchmo_checkout-step1'),
                                    checkout_step1_post_data)
        self.assertRedirects(response,
                             domain + url('DUMMY_satchmo_checkout-step2'),
                             status_code=302,
                             target_status_code=200)
        data = {
            'credit_type': 'Visa',
            'credit_number': '4485079141095836',
            'month_expires': '1',
            'year_expires': '2009',
            'ccv': '552',
            'shipping': 'FlatRate'
        }
        response = self.client.post(url('DUMMY_satchmo_checkout-step2'), data)
        self.assertRedirects(response,
                             domain + url('DUMMY_satchmo_checkout-step3'),
                             status_code=302,
                             target_status_code=200)
        response = self.client.get(url('DUMMY_satchmo_checkout-step3'))
        self.assertContains(response,
                            smart_str("Shipping + %s4.00" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1,
                            status_code=200)
        self.assertContains(response,
                            smart_str("Tax + %s4.60" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1,
                            status_code=200)
        self.assertContains(response,
                            smart_str("Total = %s54.60" %
                                      config_value('SHOP', 'CURRENCY')),
                            count=1,
                            status_code=200)
        response = self.client.post(url('DUMMY_satchmo_checkout-step3'),
                                    {'process': 'True'})
        self.assertRedirects(response,
                             domain + url('DUMMY_satchmo_checkout-success'),
                             status_code=302,
                             target_status_code=200)
        self.assertEqual(len(mail.outbox), 1)

        # Log in as a superuser
        user = User.objects.create_user('fredsu', '*****@*****.**', 'passwd')
        user.is_staff = True
        user.is_superuser = True
        user.save()
        self.client.login(username='******', password='******')

        # Test pdf generation
        response = self.client.get('/admin/print/invoice/1/')
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/packingslip/1/')
        self.assertContains(response, 'reportlab', status_code=200)
        response = self.client.get('/admin/print/shippinglabel/1/')
        self.assertContains(response, 'reportlab', status_code=200)