1
0
forked from erp-dev/erp

feat: error_code + api doc + printing-job fields

This commit is contained in:
2026-07-06 23:13:57 +08:00
parent 740d23d04b
commit ddbf798665
21 changed files with 977 additions and 17 deletions

View File

@@ -77,6 +77,8 @@ class PrintingJobAPITestCase(TestCase):
customer=self.customer,
fabric='测试布料',
width='150cm',
curve='测试曲线',
new_curve='测试新曲线',
process=self.process,
)
@@ -191,6 +193,8 @@ class PrintingJobAPITestCase(TestCase):
for item in response.data['results']:
self.assertIn('customer_name', item)
self.assertEqual(item['customer_name'], self.customer.name)
self.assertEqual(item['curve'], '测试曲线')
self.assertEqual(item['new_curve'], '测试新曲线')
self.assertIn('batch_advance_records', item)
self.assertIsInstance(item['batch_advance_records'], list)
self.assertEqual(len(item['batch_advance_records']), 0)
@@ -944,6 +948,8 @@ class PrintingJobAPITestCase(TestCase):
detail = self.client.get(f'/api/v1/printing-jobs/{job.id}/')
self.assertEqual(detail.status_code, status.HTTP_200_OK)
self.assertEqual(detail.data['external_order_id'], 'KD20410611')
self.assertEqual(detail.data['curve'], '测试曲线')
self.assertEqual(detail.data['new_curve'], '测试新曲线')
def test_filter_by_quantity_range(self):
"""测试按数量范围过滤"""