Esempio n. 1
0
 def test_date_sort(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(event_response['events'][0]['summary'],
                      'Multi Day Event')
     self.assertEqual(event_response['events'][4]['summary'],
                      'Organic Chemistry Seminar: Prof. Matthew Becker4')
Esempio n. 2
0
 def test_date_sort(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(event_response['events'][0]['summary'],
                      'Multi Day Event')
     self.assertEqual(event_response['events'][4]['summary'],
                      'Organic Chemistry Seminar: Prof. Matthew Becker4')
Esempio n. 3
0
 def test_active_cals(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['active_cals']), 1)
     self.assertEqual(event_response['active_cals'][0]['url'],
                      TRUMBA_PREFIX)
     self.assertEqual(event_response['active_cals'][0]['title'],
                      "Department of Five Events")
Esempio n. 4
0
 def test_future_two(self):
     cal = {'future_1': None, 'future_2': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(True)
     self.assertEqual(len(event_response['future_active_cals']), 2)
     self.assertEqual(len(event_response['events']), 0)
     self.assertEqual(event_response['future_active_cals'][0]['count'], 1)
     self.assertEqual(event_response['future_active_cals'][1]['count'], 2)
Esempio n. 5
0
 def test_active_cals(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['active_cals']), 1)
     self.assertEqual(event_response['active_cals'][0]['url'],
                      TRUMBA_PREFIX)
     self.assertEqual(event_response['active_cals'][0]['title'],
                      "Department of Five Events")
Esempio n. 6
0
 def test_future_two(self):
     cal = {'future_1': None,
            'future_2': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(True)
     self.assertEqual(len(event_response['future_active_cals']), 2)
     self.assertEqual(len(event_response['events']), 0)
     self.assertEqual(event_response['future_active_cals'][0]['count'], 1)
     self.assertEqual(event_response['future_active_cals'][1]['count'], 2)
Esempio n. 7
0
 def test_all_day_1(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(event_response['events'][3]['is_all_day'])
Esempio n. 8
0
 def test_event_url(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     url = "%s?%s" % (TRUMBA_PREFIX,
                      'trumbaEmbed=eventid%3D1107241160%26view%3Devent')
     self.assertEqual(event_response['events'][0]['event_url'], url)
Esempio n. 9
0
 def test_current(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['future_active_cals']), 0)
     self.assertEqual(len(event_response['events']), 5)
Esempio n. 10
0
 def test_all_day(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(event_response['events'][3]['is_all_day'])
     self.assertFalse(event_response['events'][2]['is_all_day'])
     self.assertIn('2013-04-18', event_response['events'][3]['end'])
Esempio n. 11
0
 def test_no_location(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(event_response['events'][3]['event_location'], "")
Esempio n. 12
0
 def test_all_day(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(event_response['events'][3]['is_all_day'])
Esempio n. 13
0
 def test_event_url(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     url = "%s?%s" % (TRUMBA_PREFIX,
                      'trumbaEmbed=eventid%3D1107241160%26view%3Devent')
     self.assertEqual(event_response['events'][0]['event_url'], url)
Esempio n. 14
0
 def test_current(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['future_active_cals']), 0)
     self.assertEqual(len(event_response['events']), 5)
Esempio n. 15
0
 def test_no_location(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(event_response['events'][3]['event_location'], "")
Esempio n. 16
0
 def test_future(self):
     cal = {'future_1': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['future_active_cals']), 1)
     self.assertEqual(len(event_response['events']), 0)
Esempio n. 17
0
 def test_all_day_2(self):
     cal = {'5_current': None}
     event_response = get_events(cal, self.now)
     self.assertTrue(event_response['events'][3]['is_all_day'])
     self.assertFalse(event_response['events'][2]['is_all_day'])
     self.assertIn('2013-04-18', event_response['events'][3]['end'])
Esempio n. 18
0
 def test_future(self):
     cal = {'future_1': None}
     event_response = get_events(cal, self.now)
     self.assertEqual(len(event_response['future_active_cals']), 1)
     self.assertEqual(len(event_response['events']), 0)