-
- @temprepo('empty')
- def test_documents_post(self):
- self.assertTrue(self.client.login(username='admin', password='admin'))
-
- infile = tempfile.NamedTemporaryFile("w+")
- infile.write('0123456789')
- infile.flush()
- infile.seek(0)
-
- self.response = self.client.post( reverse("document_list_view"),
- data = {
- 'bookname': 'testbook',
- 'ocr': infile,
- 'generate_dc': False,
- })
-
- infile.close()
-
- result = self.assert_json_response({
- 'url': reverse('document_view', args=['testbook']),
- 'name': 'testbook',
- 'size': 10,
- # can't test revision number, 'cause it's random
- },)
-
- @temprepo('empty')