Better rendering and javascript initialization (@andybak / #2)

This commit is contained in:
Florent Lebreton
2014-11-26 18:35:33 +01:00
parent b29c5964af
commit 02e78b1a6c
7 changed files with 46 additions and 28 deletions

View File

@@ -1,4 +1,6 @@
import json
from pyquery import PyQuery as pq
from django.test import SimpleTestCase
from django.core.exceptions import ValidationError
@@ -59,6 +61,5 @@ class JSignatureWidgetTest(SimpleTestCase):
w = JSignatureWidget()
output = w.render(name='foo', value=None)
# Almost useless :/
self.assertIn('class="jsign-wrapper"', output)
self.assertIn('type="hidden"', output)
self.assertIn('type="text/javascript"', output)
self.assertEqual(1, len(pq('.jsign-wrapper', output)))
self.assertEqual(1, len(pq('[type=hidden]', output)))