Skip to content

Commit

Permalink
HDX-9010 - adding test for adding inactive in title
Browse files Browse the repository at this point in the history
  • Loading branch information
danmihaila committed Sep 19, 2023
1 parent b037397 commit 97f762d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def test_closed_organization(self, app):
orgadmin = 'orgadmin'
context = {'model': model, 'session': model.Session, 'user': orgadmin}

user_list = _get_action('user_list')(context, {})
log.warning("0 =====display user_list=====")
log.warning(user_list)
# user_list = _get_action('user_list')(context, {})
# log.warning("0 =====display user_list=====")
# log.warning(user_list)

org_dict = _get_action('organization_show')(context, {'id': 'hdx-test-org', 'include_users':True})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_closed_organization_api(self):
new_org_dict = {
'name': 'test_org_d',
'title': 'Test Org D',
'closed_organization': 'true',
'closed_organization': True,
'org_url': 'www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
Expand All @@ -491,6 +491,7 @@ def test_closed_organization_api(self):
org_dict = self._get_action('organization_create')(context_sysadmin, new_org_dict)
assert 'closed_organization' in org_dict
assert org_dict.get('closed_organization') == True
assert '(inactive)' in org_dict.get('title')
except Exception as ex:
assert False

Expand All @@ -499,7 +500,7 @@ def test_closed_organization_api(self):
'id': org_dict.get('id'),
'name': org_dict.get('name'),
'title': org_dict.get('title'),
'closed_organization': 'false',
'closed_organization': False,
'org_url': org_dict.get('org_url'),
'description': org_dict.get('description'),
'hdx_org_type': org_dict.get('hdx_org_type'),
Expand All @@ -508,6 +509,7 @@ def test_closed_organization_api(self):
org_updated_dict = self._get_action('organization_show')(context_sysadmin, {'id': org_dict.get('id')})
assert 'closed_organization' in org_updated_dict
assert org_updated_dict.get('closed_organization') == False
assert '(inactive)' not in org_updated_dict.get('title')
except Exception as ex:
assert False

Expand All @@ -532,6 +534,7 @@ def test_closed_organization_api(self):
org_updated_dict = self._get_action('organization_show')(context_sysadmin, {'id': _org_update_dict.get('id')})
assert 'closed_organization' in org_updated_dict
assert org_updated_dict.get('closed_organization') == False
assert '(inactive)' not in org_updated_dict.get('title')
except Exception as ex:
assert False

Expand All @@ -549,6 +552,7 @@ def test_closed_organization_api(self):
org_updated_dict = self._get_action('organization_show')(context_sysadmin, {'id': org_dict.get('id')})
assert 'closed_organization' in org_updated_dict
assert org_updated_dict.get('closed_organization') == True
assert '(inactive)' in org_updated_dict.get('title')
except Exception as ex:
assert False

Expand Down

0 comments on commit 97f762d

Please sign in to comment.