def setUp(self): self.document_type = DocumentType(name='test doc type') self.document_type.save() self.document = Document( document_type=self.document_type, description='description', ) self.document.save() with open(TEST_DOCUMENT_PATH) as file_object: self.document.new_version(file_object=File(file_object))
def setUp(self): self.admin_user = User.objects.create_superuser( username=TEST_ADMIN_USERNAME, email=TEST_ADMIN_EMAIL, password=TEST_ADMIN_PASSWORD) self.document_type = DocumentType(name=TEST_DOCUMENT_TYPE) self.document_type.save() self.document = Document(document_type=self.document_type, ) self.document.save() with open(TEST_DOCUMENT_PATH) as file_object: self.document.new_version( file_object=File(file_object, name='mayan_11_1.pdf'))
def setUp(self): self.document_type = DocumentType(name='test doc type') self.document_type.save() self.document = Document( document_type=self.document_type, description='description', ) self.document.save() with open(TEST_DOCUMENT_PATH) as file_object: self.document.new_version( file_object=File(file_object, name='mayan_11_1.pdf')) with open(TEST_KEY_FILE) as file_object: gpg.import_key(file_object.read())