예제 #1
0
 def setUp(self):
     self.init_django_settings()
     self.init_testbed_for_datastore_tests()
     self.attendant = Attendant.create(email='*****@*****.**', last_name='Pantoja', first_name='Isabel', city='Sevilla', computers_needed=False)
     self.attendant.twitter_id = "@pantoja"
     self.attendant.put()
     self.attendant2 = Attendant.create(email='*****@*****.**', last_name='Smith', first_name='Will', city='Los Angeles', computers_needed=True)
     self.attendant2.put()
예제 #2
0
 def test_get_speakers_json(self):
     expected = [
         {
             "city": u"Zaragoza3",
             "first_name": u"Bill",
             "last_name": u"Gates",
             "twitter_id": u"",
             "computers_needed": True,
             "speaker": True,
             "email": u"*****@*****.**",
         },
         {
             "city": u"Valencia",
             "first_name": u"Manolo",
             "last_name": u"Bombo",
             "twitter_id": u"",
             "computers_needed": False,
             "speaker": True,
             "email": u"*****@*****.**",
         },
     ]
     self.attendant.set_as_speaker()
     self.attendant.put()
     attendant2 = Attendant.create(
         email="*****@*****.**",
         last_name="Bombo",
         first_name="Manolo",
         city="Valencia",
         computers_needed=False,
     )
     attendant2.set_as_speaker()
     attendant2.put()
     self.assertEquals(expected, Attendant.get_speakers_json())
예제 #3
0
 def test_create_attendance_constructor(self):
     attendant = Attendant.create("Asistente2", "Apellido2", "*****@*****.**", "Zaragoza2", False)
     attendant.put()
     db_attendant = Attendant.get_by_key_name("*****@*****.**")
     self.assertEquals("*****@*****.**", db_attendant.email)
     self.assertEquals("Asistente2", db_attendant.first_name)
     self.assertEquals("Apellido2", db_attendant.last_name)
     self.assertEquals("Zaragoza2", db_attendant.city)
     self.assertEquals(False, db_attendant.computers_needed)
예제 #4
0
 def test_fetch_twitter_avatar(self):
     attendant = Attendant.create(
         email="*****@*****.**",
         last_name="Apellido3",
         first_name="Asistente3",
         city="Zaragoza3",
         computers_needed=True,
     )
     attendant.twitter_id = "@gualison"
     attendant.fetch_twitter_avatar()
     self.assertTrue(attendant.twitter_avatar != None)
예제 #5
0
def init_app(request):
    if request.method == 'GET':
        User.create_admin('admin', 'aos').put()
        Room.init_rooms()
        if not Talk.all().count(1) > 0:
            talk = Talk(title = 'Android', session=1)
            talk.set_room(Room.get_rooms()[0])
            talk.put()
            talk = Talk(title = 'Kanban', session=5)
            talk.set_room(Room.get_rooms()[1])
            talk.put()
        if not Attendant.all().count(1) > 0:
            bill = Attendant.create('Bill', 'Gates', '*****@*****.**', 'Zaragoza', False)
            bill.twitter_id = 'fbgblog'
            bill.set_as_speaker()
            bill.put()
            richard = Attendant.create('Richard', 'Stallman', '*****@*****.**', 'Pamplona', True)
            richard.twitter_id = 'GNUplusLINUX'
            richard.set_as_speaker()
            richard.put()
        return HttpResponse("App ready to rumble...", mimetype="text/plain")
예제 #6
0
 def setUp(self):
     self.init_testbed_for_datastore_tests()
     self.init_django_settings()
     self.room1 = Room(name="sala1")
     self.room2 = Room(name="sala2")
     room_key1 = self.room1.put()
     room_key2 = self.room2.put()
     self.attendant_key = Attendant.create("Ponente1", "Apellido1", "*****@*****.**", "Zaragoza", False).put()
     self.talk1 = Talk(title="Titulo1", speaker=self.attendant_key, room=room_key1, session=4)
     self.talk1.put()
     Talk(title="Titulo2", speaker=self.attendant_key, room=room_key2).put()
     Talk(title="Titulo3", speaker=self.attendant_key, room=room_key1).put()
     self.talk_key_4 = Talk(title="Titulo4", speaker=self.attendant_key).put()
예제 #7
0
    def setUp(self):
        self.init_django_settings()
        self.init_testbed_for_datastore_tests()
        self.init_for_url_fetch_tests()

        self.attendant = Attendant.create(
            email="*****@*****.**",
            last_name="Gates",
            first_name="Bill",
            city="Zaragoza3",
            computers_needed=True,
        )
        self.attendant.twitter_account = "@Billgates"
        self.attendant.put()
예제 #8
0
 def test_create_attendance_constructor_named(self):
     attendant = Attendant.create(
         email="*****@*****.**",
         last_name="Apellido3",
         first_name="Asistente3",
         city="Zaragoza3",
         computers_needed=True,
     )
     attendant.put()
     db_attendant = Attendant.get_by_key_name("*****@*****.**")
     self.assertEquals("*****@*****.**", db_attendant.email)
     self.assertEquals("Asistente3", db_attendant.first_name)
     self.assertEquals("Apellido3", db_attendant.last_name)
     self.assertEquals("Zaragoza3", db_attendant.city)
     self.assertEquals(True, db_attendant.computers_needed)