'Tests the rendering of the purchase form'

@patch('shoppingcart.processors.CyberSource.render_to_string', autospec=True)
def test_render_purchase_form_html(self, render):

    student1 = UserFactory()
    student1.save()
    order1 = Order.get_cart_for_user(student1)
    item1 = OrderItem(order=order1, user=student1, unit_cost=1.0, line_cost=1.0)
    item1.save()
    render_purchase_form_html(order1)
    ((template, context), render_kwargs) = render.call_args
    self.assertEqual(template, 'shoppingcart/cybersource_form.html')
    self.assertDictContainsSubset({'amount': '1.00', 'currency': 'usd', 'orderPage_transactionType': 'sale', 'orderNumber': str(order1.id)}, context['params'])
