django-quill-editor icon indicating copy to clipboard operation
django-quill-editor copied to clipboard

Writing test code

Open LeeHanYeong opened this issue 4 years ago • 1 comments

LeeHanYeong avatar Mar 17 '20 09:03 LeeHanYeong

Hey @LeeHanYeong 😄

I really liked this package. It's awesome.

But I am facing a problem to set up my tests. I looked in the documentation and in the code for something I can use as a base to write them, but I didn't find it.

Do you have an example to guide me?

I'm currently trying something like this:

content = """{"delta":"{\"ops\":[{\"attributes\":{\"italic\":false,\"bold\":false},\"insert\":\"test\"},{\"insert\":\"\\n\"}]}","html":"<p>test</p>"}"""
data = {
    'title': 'test',
    'content': content
}
post = PostForm(data=data)
post.save()
# error django_quill.quill.QuillParseError: Failed to parse value -> value of variable content

The same error happens if I am checking that the form is valid.

gabrielloliveira avatar Aug 05 '20 16:08 gabrielloliveira