예제 #1
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")
예제 #2
0
 def test_fetch_talks_from_attendant(self):
     attendant = Attendant.all().filter("first_name", "Ponente1").get()
     self.assertEquals("Titulo1", attendant.talks[0].title)
     self.assertEquals("Titulo2", attendant.talks[1].title)
예제 #3
0
 def __init__(self, *args, **kwargs):
     super(TalkForm, self).__init__(*args, **kwargs)
     self.fields['speaker'].query = Attendant.all().filter('speaker', True).fetch(100)
예제 #4
0
 def test_search_unexisting_attendant(self):
     attendant = Attendant.all().filter("name", "PonenteN").fetch(1000)
     self.assertFalse(attendant)