Esempio n. 1
0
 def test_populate_event(self):
     location = 'bar'
     event = Event(title='Hello World Event', location=location,
                         date='2009-01-25')
     expected_slug = u'25-01-2009_hello-world-event'
     event.put()
     event = Event.gql("WHERE slug = '%s'" % str(expected_slug)).get()
     assert event.location == location
Esempio n. 2
0
    def test_create_event(self):
        form = self.app.get('/admin/events/new').form
        form['title'] = 'This is a test event'
        form['date'] = '25/01/2000'
        form['image'] = ('cows.jpg', open('tests/small_cows.jpg').read())
        form['description'] = 'great event'
        form['location'] = 'Tokyo'
        response = form.submit()

        event = Event.gql("WHERE title = :1", 'This is a test event').get()
        self.assertEqual(event.description, 'great event')
        self.assertEqual(event.location, 'Tokyo')
        self.assertEqual(event.date.day, 25)
        assert event.image