tests: improve testing by splitting tests + use six for basestring python3 compatibility
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
from pyquery import PyQuery as pq
|
||||
import six
|
||||
|
||||
from django.test import SimpleTestCase
|
||||
from django.core.exceptions import ValidationError
|
||||
@@ -48,7 +49,7 @@ class JSignatureWidgetTest(SimpleTestCase):
|
||||
w = JSignatureWidget()
|
||||
val = [{"x": [1, 2], "y": [3, 4]}]
|
||||
val_prep = w.prep_value(val)
|
||||
self.assertIsInstance(val_prep, basestring)
|
||||
self.assertIsInstance(val_prep, six.string_types)
|
||||
self.assertEquals(val, json.loads(val_prep))
|
||||
|
||||
def test_prep_value_correct_values_json(self):
|
||||
@@ -56,7 +57,7 @@ class JSignatureWidgetTest(SimpleTestCase):
|
||||
val = [{"x": [1, 2], "y": [3, 4]}]
|
||||
val_str = '[{"x":[1,2], "y":[3,4]}]'
|
||||
val_prep = w.prep_value(val_str)
|
||||
self.assertIsInstance(val_prep, basestring)
|
||||
self.assertIsInstance(val_prep, six.string_types)
|
||||
self.assertEquals(val, json.loads(val_prep))
|
||||
|
||||
def test_prep_value_incorrect_values(self):
|
||||
|
||||
Reference in New Issue
Block a user