'Ensure the view renders a page appropriately depending on the Cybersource decision.'

@ddt.data('ACCEPT', 'REJECT', 'ERROR')
def test_cybersource_decision(self, decision):

    self._login()
    post_data = {'decision': decision, 'reason_code': '200', 'signed_field_names': 'dummy'}
    expected_pattern = ('<title>(\\s+)Receipt' if (decision == 'ACCEPT') else '<title>(\\s+)Payment    Failed')
    response = self.post_to_receipt_page(post_data)
    self.assertRegexpMatches(response.content, expected_pattern)
