Skip to content

Commit

Permalink
Remove depreciations
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCorbin committed Jan 17, 2022
1 parent b394ce9 commit 899903a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jsignature/mixins.py
Expand Up @@ -5,7 +5,7 @@
import json
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from .fields import JSignatureField


Expand Down
2 changes: 1 addition & 1 deletion jsignature/widgets.py
Expand Up @@ -11,7 +11,7 @@
from django.core.exceptions import ValidationError

from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from jsignature.settings import JSIGNATURE_DEFAULT_CONFIG

JSIGNATURE_EMPTY_VALUES = validators.EMPTY_VALUES + ('[]', )
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -14,7 +14,7 @@
long_description=open(os.path.join(here, 'README.rst')).read() + '\n\n' +
open(os.path.join(here, 'CHANGES')).read(),
license='LPGL, see LICENSE file.',
install_requires=['Django>=1.11', 'pillow'],
install_requires=['Django>=1.11', 'pillow', 'pyquery>=1.4.2'],
packages=find_packages(exclude=['example_project*', 'tests']),
include_package_data=True,
zip_safe=False,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_fields.py
Expand Up @@ -24,13 +24,13 @@ def test_to_python_empty(self):
def test_to_python_correct_value_python(self):
f = JSignatureField()
val = [{"x": [1, 2], "y": [3, 4]}]
self.assertEquals(val, f.to_python(val))
self.assertEqual(val, f.to_python(val))

def test_to_python_correct_value_json(self):
f = JSignatureField()
val = [{"x": [1, 2], "y": [3, 4]}]
val_str = '[{"x":[1,2], "y":[3,4]}]'
self.assertEquals(val, f.to_python(val_str))
self.assertEqual(val, f.to_python(val_str))

def test_to_python_incorrect_value(self):
f = JSignatureField()
Expand All @@ -47,15 +47,15 @@ def test_get_prep_value_correct_values_python(self):
val = [{"x": [1, 2], "y": [3, 4]}]
val_prep = f.get_prep_value(val)
self.assertIsInstance(val_prep, string_types)
self.assertEquals(val, json.loads(val_prep))
self.assertEqual(val, json.loads(val_prep))

def test_get_prep_value_correct_values_json(self):
f = JSignatureField()
val = [{"x": [1, 2], "y": [3, 4]}]
val_str = '[{"x":[1,2], "y":[3,4]}]'
val_prep = f.get_prep_value(val_str)
self.assertIsInstance(val_prep, string_types)
self.assertEquals(val, json.loads(val_prep))
self.assertEqual(val, json.loads(val_prep))

def test_get_prep_value_incorrect_values(self):
f = JSignatureField()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_forms.py
Expand Up @@ -19,7 +19,7 @@ def test_to_python_empty_values(self):
def test_to_python_correct_values(self):
f = JSignatureField()
val = '[{"x":[1,2], "y":[3,4]}]'
self.assertEquals([{'x': [1, 2], 'y': [3, 4]}], f.to_python(val))
self.assertEqual([{'x': [1, 2], 'y': [3, 4]}], f.to_python(val))

def test_to_python_incorrect_values(self):
f = JSignatureField()
Expand Down
10 changes: 5 additions & 5 deletions tests/test_widgets.py
Expand Up @@ -25,7 +25,7 @@ def test_default_media(self):
self.assertIn('jSignature.min.js', media_js_str)
self.assertIn('django_jsignature.js', media_js_str)
media_css = list(media.render_css())
self.assertEquals([], media_css)
self.assertEqual([], media_css)

@override_settings(JSIGNATURE_JQUERY='admin')
def test_media_in_admin(self):
Expand All @@ -43,10 +43,10 @@ def test_media_custom_jquery(self):

def test_init(self):
w = JSignatureWidget()
self.assertEquals({}, w.jsignature_attrs)
self.assertEqual({}, w.jsignature_attrs)
given_attrs = {'width': 300, 'height': 100}
w = JSignatureWidget(jsignature_attrs=given_attrs)
self.assertEquals(given_attrs, w.jsignature_attrs)
self.assertEqual(given_attrs, w.jsignature_attrs)

def test_build_jsignature_id(self):
w = JSignatureWidget()
Expand All @@ -69,15 +69,15 @@ def test_prep_value_correct_values_python(self):
val = [{"x": [1, 2], "y": [3, 4]}]
val_prep = w.prep_value(val)
self.assertIsInstance(val_prep, string_types)
self.assertEquals(val, json.loads(val_prep))
self.assertEqual(val, json.loads(val_prep))

def test_prep_value_correct_values_json(self):
w = JSignatureWidget()
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, string_types)
self.assertEquals(val, json.loads(val_prep))
self.assertEqual(val, json.loads(val_prep))

def test_prep_value_incorrect_values(self):
w = JSignatureWidget()
Expand Down

0 comments on commit 899903a

Please sign in to comment.