Skip to content

Commit 06bf26e

Browse files
committed
Re-format with black.
1 parent f740b07 commit 06bf26e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

django_unicorn/components/unicorn_view.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,14 @@ def get_locations(component_name: str) -> List[Tuple[str, str]]:
111111
if ".apps." in app:
112112
is_app_config = True # default to True for backwards compatibility
113113
app_config_idx = app.rindex(".apps.")
114-
114+
115115
try:
116-
app_config_module_name = app[:app_config_idx + 5]
117-
app_config_class_name = app[app_config_idx + 6:]
116+
app_config_module_name = app[: app_config_idx + 5]
117+
app_config_class_name = app[app_config_idx + 6 :]
118118
app_config_module = importlib.import_module(app_config_module_name)
119-
is_app_config = type(getattr(app_config_module, app_config_class_name)) == type(AppConfig)
119+
is_app_config = type(
120+
getattr(app_config_module, app_config_class_name)
121+
) == type(AppConfig)
120122
except ModuleNotFoundError:
121123
pass
122124

tests/components/test_get_locations.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ def test_get_locations_installed_app_with_app_config(settings, clear_apps, cache
149149

150150
def test_get_locations_installed_app_with_apps(settings, clear_apps, cache_clear):
151151
# test when the app is in a subdirectory "apps"
152-
settings.INSTALLED_APPS = ["example.apps.main",]
153-
expected_location = [("example.apps.main.components.sidebar_menu", "SidebarMenuView")]
152+
settings.INSTALLED_APPS = [
153+
"example.apps.main",
154+
]
155+
expected_location = [
156+
("example.apps.main.components.sidebar_menu", "SidebarMenuView")
157+
]
154158
actual_location = get_locations("sidebar-menu")
155159
assert expected_location == actual_location

0 commit comments

Comments
 (0)