'Try to create a new document with an invalid category value.'

def test_new_document_POST_invalid_category(self):

    self.client.login(username='admin', password='testpass')
    data = new_document_data()
    data['category'] = 963
    response = self.client.post(reverse('wiki.new_document'), data, follow=True)
    doc = pq(response.content)
    ul = doc('#document-form    >    ul.errorlist')
    eq_(1, len(ul))
    assert ('Select    a    valid    choice.    963    is    not    one    of    the    available    choices.' in ul('li').text())
