Example #1
0
 def test_registrants(self):
     w = Webinar(self.organizer, key=2394, timezone='America/New_York', sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     r1 = Registrant(webinar=w, session=s, key=9583, first_name=u'J\u00f6hn', last_name=u'Smith', email=u'*****@*****.**', registered_at='5/1/12 18:01', join_url='http://bit.ly/482024', status='APPROVED', viewings=[(time('4/1/11 12:01'), time('4/1/11 12:22'))])
     r2 = Registrant(webinar=w, session=s, key=2305, first_name=u'Suzy', last_name=u'Samwell', email=u'*****@*****.**', registered_at='5/2/12 18:02', join_url='http://bit.ly/8592932', status='APPROVED', viewings=[(time('4/1/11 12:02'), time('4/1/11 12:07')),(time('4/1/11 12:12'), time('4/1/11 12:17')),(time('4/1/11 12:22'), time('4/1/11 12:27'))])
     r3 = Registrant(webinar=w, session=s, key=4203, first_name=u'Todd', last_name=u'Kells', email=u'*****@*****.**', registered_at='5/3/12 18:03', join_url='http://bit.ly/9293842', status='WAITING', viewings=[])
     with mocker(GetAttendees, text=self.attendees_json):
         with mocker(GetRegistrations, text=self.registrants_json):
             session = Session(w, key=6043, started_at=time('2012-06-01'))
             self.assertEquals([r1,r2,r3], session.registrants)
Example #2
0
 def test_registrations(self):
     w = Webinar(self.organizer, key=2394, registrations=[])
     ra = Registrant(webinar=w, key=9583, first_name=u'J\u00f6hn', last_name=u'Smith', email=u'*****@*****.**', registered_at='5/1/12 18:01', join_url='http://bit.ly/482024', status='WAITING')
     rb = Registrant(webinar=w, key=2305, first_name=u'Suzy', last_name=u'Samwell', email=u'*****@*****.**', registered_at='4/2/12 18:02', join_url='http://bit.ly/8583932', status='DELETED')
     rc = Registrant(webinar=w, key=2306, first_name=u'Suzy', last_name=u'Samwell', email=u'*****@*****.**', registered_at='5/2/12 18:02', join_url='http://bit.ly/8592932', status='APPROVED')
     with mocker(GetRegistrations, text=self.registrations_json):
         self.assertEquals([ra,rb,rc], Webinar(self.organizer, key=2394).registrations)
Example #3
0
 def test_future_webinars(self):
     wa = Webinar(self.organizer,
                  key=1034,
                  subject=subject(8),
                  description=description(8),
                  timezone=u"America/New_York",
                  sessions=[])
     wa.sessions.append(
         Session(wa,
                 starts_at=time('6/1/12 10:00'),
                 ends_at=time('6/1/12 11:00')))
     wb = Webinar(self.organizer,
                  key=9582,
                  subject=subject(9),
                  description=description(9),
                  timezone=u"America/New_York",
                  sessions=[])
     wb.sessions.append(
         Session(wb,
                 starts_at=time('7/1/12 12:00'),
                 ends_at=time('7/1/12 13:00')))
     wb.sessions.append(
         Session(wb,
                 starts_at=time('7/2/12 12:00'),
                 ends_at=time('7/2/12 13:00')))
     with mocker(GetFutureWebinars, text=self.future_json):
         self.assertEquals([wa, wb], self.organizer.future_webinars)
Example #4
0
 def test_register(self):
     w = Webinar(self.organizer,
                 key=2394,
                 timezone='America/New_York',
                 sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     s.attendees.append(
         Registrant(webinar=w,
                    session=s,
                    key=2305,
                    first_name=u'Suzy',
                    last_name=u'Samwell',
                    email=u'*****@*****.**',
                    duration=delta(s=4931)))
     with mocker(CreateRegistrant, text=self.registered_json):
         seed_registrant = Registrant(webinar=w,
                                      session=s,
                                      first_name=u'J\u00f6hn',
                                      last_name=u'Smith',
                                      email=u'*****@*****.**')
         expected_registrant = Registrant(
             webinar=w,
             session=s,
             key=2038,
             first_name=u'J\u00f6hn',
             last_name=u'Smith',
             email=u'*****@*****.**',
             join_url='https://bit.ly/00293423')
         self.assertEquals(expected_registrant, seed_registrant.create())
Example #5
0
 def test_attendees(self):
     w = Webinar(self.organizer,
                 key=2394,
                 timezone='America/New_York',
                 sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     a1 = Registrant(webinar=w,
                     session=s,
                     key=9583,
                     first_name=u'J\u00f6hn',
                     last_name=u'Smith',
                     email=u'*****@*****.**',
                     viewings=[(time('4/1/11 12:01'), time('4/1/11 12:22'))
                               ])
     a2 = Registrant(webinar=w,
                     session=s,
                     key=2305,
                     first_name=u'Suzy',
                     last_name=u'Samwell',
                     email=u'*****@*****.**',
                     viewings=[(time('4/1/11 12:02'), time('4/1/11 12:07')),
                               (time('4/1/11 12:12'), time('4/1/11 12:17')),
                               (time('4/1/11 12:22'), time('4/1/11 12:27'))
                               ])
     with mocker(GetAttendees, text=self.attendees_json):
         session = Session(w, key=6043, started_at=time('2012-06-01'))
         self.assertEquals([a1, a2], session.attendees)
Example #6
0
 def test_attendees(self):
     w = Webinar(self.organizer, key=2394, timezone='America/New_York', sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     a1 = Registrant(webinar=w, session=s, key=9583, first_name=u'J\u00f6hn', last_name=u'Smith', email=u'*****@*****.**', viewings=[(time('4/1/11 12:01'), time('4/1/11 12:22'))])
     a2 = Registrant(webinar=w, session=s, key=2305, first_name=u'Suzy', last_name=u'Samwell', email=u'*****@*****.**', viewings=[(time('4/1/11 12:02'), time('4/1/11 12:07')),(time('4/1/11 12:12'), time('4/1/11 12:17')),(time('4/1/11 12:22'), time('4/1/11 12:27'))])
     with mocker(GetAttendees, text=self.attendees_json):
         session = Session(w, key=6043, started_at=time('2012-06-01'))
         self.assertEquals([a1,a2], session.attendees)
Example #7
0
 def test_register(self):
     w = Webinar(self.organizer, key=2394, timezone='America/New_York', sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     s.attendees.append(Registrant(webinar=w, session=s, key=2305, first_name=u'Suzy', last_name=u'Samwell', email=u'*****@*****.**', duration=delta(s=4931)))
     with mocker(CreateRegistrant, text=self.registered_json):
         seed_registrant = Registrant(webinar=w, session=s, first_name=u'J\u00f6hn', last_name=u'Smith', email=u'*****@*****.**')
         expected_registrant = Registrant(webinar=w, session=s, key=2038, first_name=u'J\u00f6hn', last_name=u'Smith', email=u'*****@*****.**', join_url='https://bit.ly/00293423')
         self.assertEquals(expected_registrant, seed_registrant.create())
Example #8
0
 def test_future_webinars(self):
     wa = Webinar(self.organizer, key=1034, subject=subject(8), description=description(8), timezone=u"America/New_York", sessions=[])
     wa.sessions.append(Session(wa, starts_at=time('6/1/12 10:00'), ends_at=time('6/1/12 11:00')))
     wb = Webinar(self.organizer, key=9582, subject=subject(9), description=description(9), timezone=u"America/New_York", sessions=[])
     wb.sessions.append(Session(wb, starts_at=time('7/1/12 12:00'), ends_at=time('7/1/12 13:00')))
     wb.sessions.append(Session(wb, starts_at=time('7/2/12 12:00'), ends_at=time('7/2/12 13:00')))
     with mocker(GetFutureWebinars, text=self.future_json):
         self.assertEquals([wa,wb], self.organizer.future_webinars)
Example #9
0
 def test_registrants(self):
     w = Webinar(self.organizer,
                 key=2394,
                 timezone='America/New_York',
                 sessions=[])
     s = Session(w, key=6043, started_at=time('2012-06-01'), attendees=[])
     r1 = Registrant(webinar=w,
                     session=s,
                     key=9583,
                     first_name=u'J\u00f6hn',
                     last_name=u'Smith',
                     email=u'*****@*****.**',
                     registered_at='5/1/12 18:01',
                     join_url='http://bit.ly/482024',
                     status='APPROVED',
                     viewings=[(time('4/1/11 12:01'), time('4/1/11 12:22'))
                               ])
     r2 = Registrant(webinar=w,
                     session=s,
                     key=2305,
                     first_name=u'Suzy',
                     last_name=u'Samwell',
                     email=u'*****@*****.**',
                     registered_at='5/2/12 18:02',
                     join_url='http://bit.ly/8592932',
                     status='APPROVED',
                     viewings=[(time('4/1/11 12:02'), time('4/1/11 12:07')),
                               (time('4/1/11 12:12'), time('4/1/11 12:17')),
                               (time('4/1/11 12:22'), time('4/1/11 12:27'))
                               ])
     r3 = Registrant(webinar=w,
                     session=s,
                     key=4203,
                     first_name=u'Todd',
                     last_name=u'Kells',
                     email=u'*****@*****.**',
                     registered_at='5/3/12 18:03',
                     join_url='http://bit.ly/9293842',
                     status='WAITING',
                     viewings=[])
     with mocker(GetAttendees, text=self.attendees_json):
         with mocker(GetRegistrations, text=self.registrants_json):
             session = Session(w, key=6043, started_at=time('2012-06-01'))
             self.assertEquals([r1, r2, r3], session.registrants)
Example #10
0
 def test_past_webinars(self):
     wa = Webinar(self.organizer, key=8471, subject=subject(1), description=description(1), timezone=u"America/New_York", sessions=[])
     wa.sessions.append(Session(wa, starts_at=time('6/1/11 10:00'), ends_at=time('6/1/11 11:00')))
     wb = Webinar(self.organizer, key=2394, subject=subject(2), description=description(2), timezone=u"America/New_York", sessions=[])
     wb.sessions.append(Session(wb, starts_at=time('7/1/11 12:00'), ends_at=time('7/1/11 13:00')))
     wb.sessions.append(Session(wb, starts_at=time('7/2/11 12:00'), ends_at=time('7/2/11 13:00')))
     wc = Webinar(self.organizer, key=3948, subject=subject(3), description=description(3), timezone=u"America/Los_Angeles", sessions=[])
     wc.sessions.append(Session(wc, starts_at=time('9/1/11 13:00'), ends_at=time('9/1/11 14:00')))
     with mocker(GetPastWebinars, text=self.past_json):
         self.assertEquals([wa,wb,wc], self.organizer.past_webinars)
Example #11
0
 def test_webinars(self):
     wa = Webinar(self.organizer, key=8471, subject=subject(1), description=description(1), timezone=u"America/New_York", sessions=[])
     wa.sessions.append(Session(wa, key=4942, attendant_count=11, started_at=time('6/1/11 10:01'), ended_at=time('6/1/11 11:01'), starts_at=time('6/1/11 10:00'), ends_at=time('6/1/11 11:00')))
     wb = Webinar(self.organizer, key=2394, subject=subject(2), description=description(2), timezone=u"America/New_York", sessions=[])
     wb.sessions.append(Session(wb, key=6043, attendant_count=22, started_at=time('7/1/11 12:02'), ended_at=time('7/1/11 13:02'), starts_at=time('7/1/11 12:00'), ends_at=time('7/1/11 13:00')))
     wb.sessions.append(Session(wb, key=5028, attendant_count=33, started_at=time('7/2/11 12:02'), ended_at=time('7/2/11 13:02'), starts_at=time('7/2/11 12:00'), ends_at=time('7/2/11 13:00')))
     wb.sessions.append(Session(wb, key=4023, attendant_count=44, started_at=time('8/1/11 12:03'), ended_at=time('8/1/11 13:03')))
     wc = Webinar(self.organizer, key=3948, subject=subject(3), description=description(3), timezone=u"America/Los_Angeles", sessions=[])
     wc.sessions.append(Session(wc, key=8427, attendant_count=55, started_at=time('9/1/11 18:04'), ended_at=time('9/1/11 19:04'), starts_at=time('9/1/11 13:00'), ends_at=time('9/1/11 14:00')))
     wd = Webinar(self.organizer, key=1034, subject=subject(8), description=description(8), timezone=u"America/New_York", sessions=[])
     wd.sessions.append(Session(wd, starts_at=time('6/1/12 10:00'), ends_at=time('6/1/12 11:00')))
     we = Webinar(self.organizer, key=9582, subject=subject(9), description=description(9), timezone=u"America/New_York", sessions=[])
     we.sessions.append(Session(we, starts_at=time('7/1/12 12:00'), ends_at=time('7/1/12 13:00')))
     we.sessions.append(Session(we, starts_at=time('7/2/12 12:00'), ends_at=time('7/2/12 13:00')))
     with mocker(GetPastWebinars, text=self.past_json):
         with mocker(GetFutureWebinars, text=self.future_json):
             with mocker(GetSessionedWebinars, text=self.sessioned_json):
                 self.assertEquals([wa,wb,wc,wd,we], self.organizer.webinars)
                 for w in self.organizer.webinars:
                     for s in w.sessions:
                         self.assertEquals(id(w),id(s.webinar))
Example #12
0
 def test_sessioned_webinars(self):
     wa = Webinar(self.organizer, key=8471, sessions=[])
     wa.sessions.append(Session(wa, key=4942, attendant_count=11, started_at=time('6/1/11 10:01'), ended_at=time('6/1/11 11:01')))
     wb = Webinar(self.organizer, key=2394, sessions=[])
     wb.sessions.append(Session(wb, key=6043, attendant_count=22, started_at=time('7/1/11 12:02'), ended_at=time('7/1/11 13:02')))
     wb.sessions.append(Session(wb, key=5028, attendant_count=33, started_at=time('7/2/11 12:02'), ended_at=time('7/2/11 13:02')))
     wb.sessions.append(Session(wb, key=4023, attendant_count=44, started_at=time('8/1/11 12:03'), ended_at=time('8/1/11 13:03')))
     wc = Webinar(self.organizer, key=3948, sessions=[])
     wc.sessions.append(Session(wc, key=8427, attendant_count=55, started_at=time('9/1/11 18:04'), ended_at=time('9/1/11 19:04')))
     with mocker(GetSessionedWebinars, text=self.sessioned_json):
         self.assertEquals(wa, self.organizer.sessioned_webinars[0])
         self.assertEquals(wb, self.organizer.sessioned_webinars[1])
         self.assertEquals(wc, self.organizer.sessioned_webinars[2])
         self.assertEquals([wa,wb,wc], self.organizer.sessioned_webinars)
Example #13
0
 def test_sessioned_webinars(self):
     wa = Webinar(self.organizer, key=8471, sessions=[])
     wa.sessions.append(
         Session(wa,
                 key=4942,
                 attendant_count=11,
                 started_at=time('6/1/11 10:01'),
                 ended_at=time('6/1/11 11:01')))
     wb = Webinar(self.organizer, key=2394, sessions=[])
     wb.sessions.append(
         Session(wb,
                 key=6043,
                 attendant_count=22,
                 started_at=time('7/1/11 12:02'),
                 ended_at=time('7/1/11 13:02')))
     wb.sessions.append(
         Session(wb,
                 key=5028,
                 attendant_count=33,
                 started_at=time('7/2/11 12:02'),
                 ended_at=time('7/2/11 13:02')))
     wb.sessions.append(
         Session(wb,
                 key=4023,
                 attendant_count=44,
                 started_at=time('8/1/11 12:03'),
                 ended_at=time('8/1/11 13:03')))
     wc = Webinar(self.organizer, key=3948, sessions=[])
     wc.sessions.append(
         Session(wc,
                 key=8427,
                 attendant_count=55,
                 started_at=time('9/1/11 18:04'),
                 ended_at=time('9/1/11 19:04')))
     with mocker(GetSessionedWebinars, text=self.sessioned_json):
         self.assertEquals(wa, self.organizer.sessioned_webinars[0])
         self.assertEquals(wb, self.organizer.sessioned_webinars[1])
         self.assertEquals(wc, self.organizer.sessioned_webinars[2])
         self.assertEquals([wa, wb, wc], self.organizer.sessioned_webinars)
Example #14
0
 def test_past_webinars(self):
     wa = Webinar(self.organizer,
                  key=8471,
                  subject=subject(1),
                  description=description(1),
                  timezone=u"America/New_York",
                  sessions=[])
     wa.sessions.append(
         Session(wa,
                 starts_at=time('6/1/11 10:00'),
                 ends_at=time('6/1/11 11:00')))
     wb = Webinar(self.organizer,
                  key=2394,
                  subject=subject(2),
                  description=description(2),
                  timezone=u"America/New_York",
                  sessions=[])
     wb.sessions.append(
         Session(wb,
                 starts_at=time('7/1/11 12:00'),
                 ends_at=time('7/1/11 13:00')))
     wb.sessions.append(
         Session(wb,
                 starts_at=time('7/2/11 12:00'),
                 ends_at=time('7/2/11 13:00')))
     wc = Webinar(self.organizer,
                  key=3948,
                  subject=subject(3),
                  description=description(3),
                  timezone=u"America/Los_Angeles",
                  sessions=[])
     wc.sessions.append(
         Session(wc,
                 starts_at=time('9/1/11 13:00'),
                 ends_at=time('9/1/11 14:00')))
     with mocker(GetPastWebinars, text=self.past_json):
         self.assertEquals([wa, wb, wc], self.organizer.past_webinars)
Example #15
0
 def test_webinars(self):
     wa = Webinar(self.organizer,
                  key=8471,
                  subject=subject(1),
                  description=description(1),
                  timezone=u"America/New_York",
                  sessions=[])
     wa.sessions.append(
         Session(wa,
                 key=4942,
                 attendant_count=11,
                 started_at=time('6/1/11 10:01'),
                 ended_at=time('6/1/11 11:01'),
                 starts_at=time('6/1/11 10:00'),
                 ends_at=time('6/1/11 11:00')))
     wb = Webinar(self.organizer,
                  key=2394,
                  subject=subject(2),
                  description=description(2),
                  timezone=u"America/New_York",
                  sessions=[])
     wb.sessions.append(
         Session(wb,
                 key=6043,
                 attendant_count=22,
                 started_at=time('7/1/11 12:02'),
                 ended_at=time('7/1/11 13:02'),
                 starts_at=time('7/1/11 12:00'),
                 ends_at=time('7/1/11 13:00')))
     wb.sessions.append(
         Session(wb,
                 key=5028,
                 attendant_count=33,
                 started_at=time('7/2/11 12:02'),
                 ended_at=time('7/2/11 13:02'),
                 starts_at=time('7/2/11 12:00'),
                 ends_at=time('7/2/11 13:00')))
     wb.sessions.append(
         Session(wb,
                 key=4023,
                 attendant_count=44,
                 started_at=time('8/1/11 12:03'),
                 ended_at=time('8/1/11 13:03')))
     wc = Webinar(self.organizer,
                  key=3948,
                  subject=subject(3),
                  description=description(3),
                  timezone=u"America/Los_Angeles",
                  sessions=[])
     wc.sessions.append(
         Session(wc,
                 key=8427,
                 attendant_count=55,
                 started_at=time('9/1/11 18:04'),
                 ended_at=time('9/1/11 19:04'),
                 starts_at=time('9/1/11 13:00'),
                 ends_at=time('9/1/11 14:00')))
     wd = Webinar(self.organizer,
                  key=1034,
                  subject=subject(8),
                  description=description(8),
                  timezone=u"America/New_York",
                  sessions=[])
     wd.sessions.append(
         Session(wd,
                 starts_at=time('6/1/12 10:00'),
                 ends_at=time('6/1/12 11:00')))
     we = Webinar(self.organizer,
                  key=9582,
                  subject=subject(9),
                  description=description(9),
                  timezone=u"America/New_York",
                  sessions=[])
     we.sessions.append(
         Session(we,
                 starts_at=time('7/1/12 12:00'),
                 ends_at=time('7/1/12 13:00')))
     we.sessions.append(
         Session(we,
                 starts_at=time('7/2/12 12:00'),
                 ends_at=time('7/2/12 13:00')))
     with mocker(GetPastWebinars, text=self.past_json):
         with mocker(GetFutureWebinars, text=self.future_json):
             with mocker(GetSessionedWebinars, text=self.sessioned_json):
                 self.assertEquals([wa, wb, wc, wd, we],
                                   self.organizer.webinars)
                 for w in self.organizer.webinars:
                     for s in w.sessions:
                         self.assertEquals(id(w), id(s.webinar))
Example #16
0
 def test_sessions(self):
     w = Webinar(self.organizer, key=2394, sessions=[])
     sa = Session(w, key=6043, attendant_count=22, started_at=time('7/1/11 12:02'), ended_at=time('7/1/11 13:02'))
     sb = Session(w, key=5028, attendant_count=33, started_at=time('7/2/11 12:02'), ended_at=time('7/2/11 13:02'))
     with mocker(GetSessions, text=self.sessions_json):
         self.assertEquals([sa,sb], Webinar(self.organizer, key=2394).sessions)