def test_failure_page(self):
processor_id = '3'
with responses.RequestsMock() as rsps:
rsps.add(rsps.GET, api_url('/payments/'), json={
'uuid': 'wargle-blargle',
'processor_id': processor_id,
'recipient_name': 'James Bond',
'amount': 2000,
'status': 'pending',
'created': datetime.datetime.now().isoformat() + 'Z',
'prisoner_number': 'A5544CD',
'prisoner_dob': '1992-12-05'
})
rsps.add(rsps.GET, govuk_url('/payments/%s' % processor_id), json={
'state': {'status': 'failed'}
})
self.driver.get(self.live_server_url + '/en-gb/debit-card/confirmation/?payment_ref=REF12345')
self.assertInSource('We’re sorry, your payment could not be processed on this occasion')
self.assertInSource('Your reference number is <strong>REF12345</strong>')
test_functional.py 文件源码
python
阅读 34
收藏 0
点赞 0
评论 0
评论列表
文章目录