Skip to content
Snippets Groups Projects
Commit a949d126 authored by slobinger's avatar slobinger
Browse files

Merge branch '12-bugfix-test_main_app' into 'master'

Resolve "test_main_app sollte auch funktionieren wenn man die die namen test und test.app vertauscht"

Closes #12

See merge request !7
parents a518e7b3 8804817e
Branches
Tags
1 merge request!7Resolve "test_main_app sollte auch funktionieren wenn man die die namen test und test.app vertauscht"
......@@ -35,7 +35,7 @@ class SAMSHub:
raise TypeError('Argument app has to be a SAMSApp.')
self._apps[app.name] = app
self._appList.append(app)
if app.name is self._config.get('main_app'):
if app.name == self._config.get('main_app'):
self._flaskApp.register_blueprint(app.blueprint)
else:
self._flaskApp.register_blueprint(
......@@ -78,7 +78,7 @@ class SAMSHub:
def menu(self, langCode):
menu = []
for app in self._appList:
if self._config.get('main_app') is app.name:
if self._config.get('main_app') == app.name:
menu.extend(app.menu(langCode = langCode))
else:
menu.extend(app.menu(langCode = langCode, urlPrefix = app.name))
......
......@@ -53,7 +53,7 @@ class CaseSAMSHubWithMainApp(unittest.TestCase):
with self.subTest(main_app = main_app, extra_app = extra_app):
hub = SAMSHub(
name = 'test',
config = {'default_language': 'de', 'main_app' : main_app}
config = {'default_language': 'de', 'main_app' : ''.join(main_app)}
)
expected_names = [
'Hauptanwendung Punkt 1', 'Hauptanwendung Punkt 2',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment