'Test the DocumentForm\'s category validation.
Submit the form without a category set, and it should complain, even
though it\'s not a strictly required field (because it cannot be set for
translations).'

def test_new_document_missing_category(self):

    self.client.login(username='admin', password='testpass')
    data = new_document_data()
    del data['category']
    response = self.client.post(reverse('wiki.new_document'), data, follow=True)
    self.assertContains(response, 'Please    choose    a    category.')
