add event mail addresses to the /events endpoints
This commit is contained in:
parent
55cef1128e
commit
f44da341b4
10 changed files with 90 additions and 13 deletions
|
@ -54,3 +54,15 @@ class EventTestCase(TestCase):
|
|||
response = client.delete(f'/api/2/events/{event.eid}/')
|
||||
self.assertEqual(response.status_code, 204)
|
||||
self.assertEqual(len(Event.objects.all()), 1)
|
||||
|
||||
def test_items2(self):
|
||||
from mail.models import EventAddress
|
||||
event1 = Event.objects.create(slug='TEST1', name='Event')
|
||||
EventAddress.objects.create(event=Event.objects.get(slug='TEST1'), address='foo@bar.baz')
|
||||
response = self.client.get('/api/2/events/')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(1, len(response.json()))
|
||||
self.assertEqual('TEST1', response.json()[0]['slug'])
|
||||
self.assertEqual('Event', response.json()[0]['name'])
|
||||
self.assertEqual(1, len(response.json()[0]['addresses']))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue