#69 test(ReconciliationJar): add failed case.
This commit is contained in:
parent
ef721a6b53
commit
1f2f484e95
@ -113,6 +113,30 @@ class TestJarReconcliation(TestCase):
|
|||||||
reconciliation.clean()
|
reconciliation.clean()
|
||||||
reconciliation.save()
|
reconciliation.save()
|
||||||
|
|
||||||
|
def test_fail_create_reconciliation_with_wrong_total_purchases_purchases(self):
|
||||||
|
url = '/don_confiao/reconciliation_jar/create'
|
||||||
|
total_purchases = (11 * 72500) + (27 * 72500)
|
||||||
|
bad_total_purchases = total_purchases + 2
|
||||||
|
data = {
|
||||||
|
'date_time': '2024-12-02T21:07',
|
||||||
|
'cashman': 'carlos',
|
||||||
|
'total_cash_purchases': bad_total_purchases,
|
||||||
|
'cash_taken': total_purchases,
|
||||||
|
'cash_discrepancy': 0,
|
||||||
|
'purchases': json.dumps([#machete por error al codificar el json en el request
|
||||||
|
self.purchase.id,
|
||||||
|
self.purchase2.id,
|
||||||
|
self.purchase.id,
|
||||||
|
]),
|
||||||
|
}
|
||||||
|
response = self.client.post(url, data, format='json')
|
||||||
|
rawContent = response.content.decode('utf-8')
|
||||||
|
content = json.loads(rawContent)
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code, 400)
|
||||||
|
self.assertIn('error', content)
|
||||||
|
self.assertIn('total_cash_purchases', content['error'])
|
||||||
|
|
||||||
def test_create_reconciliation_with_purchases(self):
|
def test_create_reconciliation_with_purchases(self):
|
||||||
url = '/don_confiao/reconciliation_jar/create'
|
url = '/don_confiao/reconciliation_jar/create'
|
||||||
total_purchases = (11 * 72500) + (27 * 72500)
|
total_purchases = (11 * 72500) + (27 * 72500)
|
||||||
|
Loading…
Reference in New Issue
Block a user