Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
llazzaro committed May 29, 2016
1 parent ee36a91 commit 7030569
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def test_occurences_api_returns_the_expected_occurences(self):
datetime.datetime(2008, 1, 6)
))
self.assertEqual(self.response.status_code, 200)
expected_content = '[{"start": "2008-01-05T08:00:00+00:00", "end": "2008-01-05T09:00:00+00:00", "description": null, "title": "Recent Event", "event_id": 8, "existed": false, "id": 9, "color": null}]'
self.assertEquals(self.response.content, expected_content)
expected_content = [{u'existed': False, u'end': u'2008-01-05T09:00:00+00:00', u'description': None, u'creator': u'None', u'color': None, u'title': u'Recent Event', u'rule': u'', u'event_id': 8, u'end_recurring_period': u'2008-05-05T00:00:00+00:00', u'cancelled': False, u'calendar': u'MyCalSlug', u'start': u'2008-01-05T08:00:00+00:00', u'id': 9}]
self.assertEquals(json.loads(self.response.content), expected_content)

def test_occurences_api_without_parameters_return_status_400(self):
self.response = self.client.get(reverse("api_occurences"))
Expand Down Expand Up @@ -206,8 +206,8 @@ def test_occurences_api_checks_valid_occurrence_ids(self):
datetime.datetime(2008, 1, 8)
))
self.assertEqual(self.response.status_code, 200)
expected_content = '[{"start": "2008-01-05T08:00:00+00:00", "end": "2008-01-05T09:00:00+00:00", "description": null, "title": "Recent Event", "event_id": 8, "existed": false, "id": 10, "color": null}, {"start": "2008-01-06T08:00:00+00:00", "end": "2008-01-06T09:00:00+00:00", "description": null, "title": "Recent Event", "event_id": 8, "existed": false, "id": 10, "color": null}, {"start": "2008-01-07T08:00:00+00:00", "end": "2008-01-07T09:00:00+00:00", "description": null, "title": "Recent Event", "event_id": 8, "existed": false, "id": 10, "color": null}, {"start": "2008-01-07T08:00:00+00:00", "end": "2008-01-07T08:00:00+00:00", "description": "Persisted occ test", "title": "My persisted Occ", "event_id": 8, "existed": true, "id": 1, "color": null}]'
self.assertEquals(self.response.content, expected_content)
expected_content = [{u'existed': False, u'end': u'2008-01-05T09:00:00+00:00', u'description': None, u'creator': u'None', u'color': None, u'title': u'Recent Event', u'rule': u'', u'event_id': 8, u'end_recurring_period': u'2008-01-08T00:00:00+00:00', u'cancelled': False, u'calendar': u'MyCalSlug', u'start': u'2008-01-05T08:00:00+00:00', u'id': 10}, {u'existed': False, u'end': u'2008-01-06T09:00:00+00:00', u'description': None, u'creator': u'None', u'color': None, u'title': u'Recent Event', u'rule': u'', u'event_id': 8, u'end_recurring_period': u'2008-01-08T00:00:00+00:00', u'cancelled': False, u'calendar': u'MyCalSlug', u'start': u'2008-01-06T08:00:00+00:00', u'id': 10}, {u'existed': False, u'end': u'2008-01-07T09:00:00+00:00', u'description': None, u'creator': u'None', u'color': None, u'title': u'Recent Event', u'rule': u'', u'event_id': 8, u'end_recurring_period': u'2008-01-08T00:00:00+00:00', u'cancelled': False, u'calendar': u'MyCalSlug', u'start': u'2008-01-07T08:00:00+00:00', u'id': 10}, {u'existed': True, u'end': u'2008-01-07T08:00:00+00:00', u'description': u'Persisted occ test', u'creator': u'None', u'color': None, u'title': u'My persisted Occ', u'rule': u'', u'event_id': 8, u'end_recurring_period': u'2008-01-08T00:00:00+00:00', u'cancelled': False, u'calendar': u'MyCalSlug', u'start': u'2008-01-07T08:00:00+00:00', u'id': 1}]
self.assertEquals(json.loads(self.response.content), expected_content)

def test_occurences_api_works_with_and_without_cal_slug(self):
# create a calendar and event
Expand Down

0 comments on commit 7030569

Please sign in to comment.