def test_start_date_gte_end_date(self):
        """Ensure event's start date is earlier than it's end date.

        This is a regression test for
        https://github.com/swcarpentry/amy/issues/436"""
        data = {
            'host': self.test_host.id,
            'tags': [self.test_tag.id],
            'slug': 'test-event',
            'start': date(2015, 7, 20),
            'end': date(2015, 7, 19),
            'invoice_status': 'unknown',
        }
        response = self.client.post(reverse('event_add'), data)
        assert response.status_code == 200
        content = response.content.decode('utf-8')
        assert 'Must not be earlier than start date' in content

        data = {
            'host': self.test_host.id,
            'tags': [self.test_tag.id],
            'slug': 'test-event',
            'start': date(2015, 7, 20),
            'end': date(2015, 7, 20),
            'invoice_status': 'unknown',
        }
        response = self.client.post(reverse('event_add'), data)
        assert response.status_code == 302

        data = {
            'host': self.test_host.id,
            'tags': [self.test_tag.id],
            'slug': 'test-event2',
            'start': date(2015, 7, 20),
            'end': date(2015, 7, 21),
            'invoice_status': 'unknown',
        }
        response = self.client.post(reverse('event_add'), data)
        assert response.status_code == 302
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py/TestEventViews.test_start_date_gte_end_date/original