Skip to content

ValidationError in decrypt_file #1

@ghost

Description

I have created an app to test your module ,which I called encfiles and I created a model called Document with a FileField called file.
So far I have succesfully encrypted the file as you will see below ,my file has the ".enc" extension.
I am facing a ValidationError when I am trying to decrypt the file.
Here is my tests inside the python shell.

>>> from encfiles.models import *
>>> from djangoencryptfile import EncryptionService, ValidationError
>>> service = EncryptionService()
>>> password = '123'
>>> data = Document.objects.get(pk=1)
>>> myfile = data.file
>>> myfile
<FieldFile: uploaded_files/new_path.txt.enc>
>>> decrypt_file = service.decrypt_file(myfile, password, extension='.enc')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/danai/pki/local/lib/python2.7/site-packages/djangoencryptfile/django_encrypt_file.py", line 123, in decrypt_file
    return self._return_or_raise('File does not exist')
  File "/home/danai/pki/local/lib/python2.7/site-packages/djangoencryptfile/django_encrypt_file.py", line 149, in _return_or_raise
    raise ValidationError(msg)
ValidationError: File does not exist

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions