recipe links
This commit is contained in:
@@ -246,6 +246,21 @@ class McpHttpTests(LiveServerTestCase):
|
||||
asyncio.run(self._client(self.secret, check))
|
||||
self.assertEqual(KitchenInventoryItem.objects.filter(pk__in=[item.pk for item in items], archived_at__isnull=False).count(), 2)
|
||||
|
||||
def test_inventory_bulk_update_handles_twenty_three_rows_in_one_call(self):
|
||||
location = InventoryLocation.objects.create(user=self.a, name='Pantry')
|
||||
items = [KitchenInventoryItem.objects.create(user=self.a, product=self.a_product, location=location)
|
||||
for _ in range(23)]
|
||||
|
||||
async def check(client):
|
||||
request = {'items': [{'item_id': str(item.api_id), 'changes': {'notes': 'Audited'}} for item in items],
|
||||
'dry_run': False, 'atomic': True, 'idempotency_key': 'mcp-bulk-23'}
|
||||
result = (await client.call_tool('inventory_bulk_update', request)).structured_content
|
||||
self.assertEqual(result['counts']['changed'], 23)
|
||||
self.assertEqual(result['status'], 'success')
|
||||
|
||||
asyncio.run(self._client(self.secret, check))
|
||||
self.assertEqual(KitchenInventoryItem.objects.filter(user=self.a, notes='Audited').count(), 23)
|
||||
|
||||
def test_oauth_issued_pat_authenticates_mcp_with_journal_upgrade(self):
|
||||
application = Application.objects.create(user=self.a, name='Test ChatGPT style client',
|
||||
client_type=Application.CLIENT_PUBLIC, authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE,
|
||||
|
||||
Reference in New Issue
Block a user