def test_should_edit_an_event(self): old_field_name = browser.find_by_name('name').first.value browser.fill('name', 'new event name') browser.find_by_name('save').first.click() new_event_name = browser.find_by_name('name').first.value self.assertNotEqual(new_event_name, old_field_name)
def test_should_add_an_event(self): events_count = Event.objects.all().count() browser.fill('name', 'a really cool event') browser.fill('description_en_us', 'this is a really cool event') browser.fill('date', '10/02/10') browser.attach_file('logo', os.path.abspath('events/tests/data/batcat.jpg')) browser.find_by_name('save').first.click() self.assertGreater(Event.objects.all().count(), events_count) Event.objects.filter(name='a really cool event').delete()