2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-18 08:31:33 +00:00

Add API Calendar for Return Orders (#4899)

* Add RO to calendar output

* Update title and description to be more descriptive

* Add documentation

* Add simple test for RO calendar

* Lint/syntax

* Lint

* Changes to title, description
This commit is contained in:
miggland
2023-05-26 09:01:04 +02:00
committed by GitHub
parent 5dd6f18495
commit 4d76708bee
3 changed files with 39 additions and 7 deletions

View File

@@ -2200,3 +2200,15 @@ class ReturnOrderTests(InvenTreeAPITestCase):
self.assertEqual(deltas['customer'], customer.pk)
self.assertEqual(deltas['location'], 1)
self.assertEqual(deltas['returnorder'], rma.pk)
def test_ro_calendar(self):
"""Test the calendar export endpoint"""
# Full test is in test_po_calendar. Since these use the same backend, test only
# that the endpoint is available
url = reverse('api-po-so-calendar', kwargs={'ordertype': 'return-order'})
# Test without completed orders
response = self.get(url, expected_code=200, format=None)
calendar = Calendar.from_ical(response.content)
self.assertIsInstance(calendar, Calendar)