def test_prolematic_slug(self): location = 'bar' event = Event(title='Festipop 2010 avec Roots League, Lion Roots et ... Iration Steppas !', location=location, date='2010-05-28') expected_slug = u'28-05-2010_festipop-2010-avec-roots-league-lion-roots-et-iration-steppas' event.put() self.assertEqual(event.slug, expected_slug)
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
def test_event_page(self): location = 'Somewhere' title = "This+is*a;weird Title" event = Event(title=title, date=self.str2date('2009-01-31'), location=location, published=True) event.put() slug = "31-01-2009_this-is-a-weird-title" self.assertEqual(event.slug, slug) response = self.app.get('/events/%s' % slug) assert location in response, location + ' should be in ' + response.body
def test_main_image(self): event = Event(title='foo', location='bar', date='2009-01-01') event.put()