The integration test has a function called 'is_the_page_title' which checks the title of current page with title assigned for each page on horizon like Login page has its own title etc.
The comparison and raising of AssertionError when title doesnt meet actual page title , can be easily replaced with unittest built-in function 'assertIn( str1, str2, msg ) as follows:
ORIGINAL:
def is_the_current_page(self):
if self._page_title not in self.page_title:
raise AssertionError(
"Expected to find %s in page title, instead found: %s"
% (self._page_title, self.page_title))
PROPOSED :
def is_the_current_page(self):
self.assertIn(title, self.page_title,
"Expected to find %s in page title, instead found: %s"
% (self._page_title, self.page_title))
The source code for the specific function is here : https://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/test/integration_tests/pages/pageobject.py
Fix proposed to branch: master /review. openstack. org/165711
Review: https:/