Skip to content

Commit

Permalink
fix #133 and #134
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Nov 21, 2023
1 parent e0054b5 commit 219d5ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions render_static/tests/js_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,16 @@ def test_class_url_overrides(self):
self.assertEqual(js_dict['app2:app1:re_path_unnamed'][key], value)

self.assertEqual(js_dict['path_tst'], '/test/different/1/xo')
self.assertTrue(js_dict['deepEqual'])

for func in ['constructor', 'match', 'deepEqual', 'isObject', 'reverse']:
functions = ['constructor', 'match', 'reverse']
if DJANGO_VERSION[0:2] < (4, 1): # pragma: no cover
self.assertTrue(js_dict['deepEqual'])
functions.append('deepEqual')
functions.append('isObject')
else: # pragma: no cover
pass

for func in functions:
for key, value in expected_context.items():
self.assertEqual(js_dict[func + '_ctx'][key], value)

Expand Down
8 changes: 6 additions & 2 deletions render_static/transpilers/urls_to_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,9 @@ def impl() -> Generator[str, None, None]:
self.outdent()
yield '}'

def deep_equal(self) -> Generator[Optional[str], None, None]:
def deep_equal(
self
) -> Generator[Optional[str], None, None]: # pragma: no cover
"""
The recursive deepEqual function.
:yield: The JavaScript jdoc comment lines and deepEqual function.
Expand Down Expand Up @@ -1255,7 +1257,9 @@ def impl() -> Generator[str, None, None]:
self.outdent()
yield '}'

def is_object(self) -> Generator[Optional[str], None, None]:
def is_object(
self
) -> Generator[Optional[str], None, None]: # pragma: no cover
"""
The isObject() function.
:yield: The JavaScript jdoc comment lines and isObject function.
Expand Down

0 comments on commit 219d5ca

Please sign in to comment.