Skip to content

Commit

Permalink
Additional tweaks per feedback/tests
Browse files Browse the repository at this point in the history
- Reverted last commit's swap of argparse.Namespace for mock.MagicMock since mock requires the "name" argument, which isn't allowed by MagicMock on initialization
- Added reactpy to dependencies in environment.yml
  • Loading branch information
shawncrawley committed Oct 23, 2024
1 parent 01bdf94 commit 8a810af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,5 @@ dependencies:

# reactpy dependencies
- pip:
- reactpy
- reactpy-django
11 changes: 6 additions & 5 deletions tests/unit_tests/test_tethys_apps/test_base/test_app_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.db.utils import ProgrammingError
from django.test import RequestFactory, override_settings
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from argparse import Namespace

from tethys_apps.exceptions import (
TethysAppSettingDoesNotExist,
Expand Down Expand Up @@ -1557,11 +1558,11 @@ def test_navigation_links_auto_excluded_page(self):
app.root_url = "test-app"

app._registered_url_maps = [
mock.MagicMock(name="exclude_page", title="Exclude Page", index=-1),
mock.MagicMock(name="last_page", title="Last Page", index=3),
mock.MagicMock(name="third_page", title="Third Page", index=2),
mock.MagicMock(name="second_page", title="Second Page", index=1),
mock.MagicMock(name="home", title="Home", index=0),
Namespace(name="exclude_page", title="Exclude Page", index=-1),
Namespace(name="last_page", title="Last Page", index=3),
Namespace(name="third_page", title="Third Page", index=2),
Namespace(name="second_page", title="Second Page", index=1),
Namespace(name="home", title="Home", index=0),
]

links = app.navigation_links
Expand Down

0 comments on commit 8a810af

Please sign in to comment.