def test_company_heading(self): # test company_slug = None returns None self.assertIsNone(helpers.bread_box_company_heading(None)) # test company slug w/ valid business unit returns business unit's title company = factories.CompanyFactory() company.company_slug = self.businessunit.title_slug self.assertEqual(helpers.bread_box_company_heading(company.company_slug), self.businessunit.title) # test company slug that does not match a business unit returns the company slug back, but "deslugified" company.company_slug = 'thisslugisntvalid' self.assertEqual(helpers.bread_box_company_heading(company.company_slug), company.company_slug.replace('-', ' ').title()) # extra test to ensure businessunit.title != company_slug self.assertNotEqual(helpers.bread_box_company_heading(company.company_slug), self.businessunit.title)
def build_company_breadcrumbs_from_slugs(self): company_slug_value = self.filters.get("company_slug") display_title = helpers.bread_box_company_heading(company_slug_value, self.jobs) breadcrumb = self.build_breadcrumb_for_slug_type("company_slug", display_title) if breadcrumb: self.company_breadcrumb = breadcrumb self._make_clear_breadcrumb()
def build_company_breadcrumbs_from_slugs(self): company_slug_value = self.filters.get('company_slug') display_title = helpers.bread_box_company_heading( company_slug_value, self.jobs) breadcrumb = self.build_breadcrumb_for_slug_type( 'company_slug', display_title) if breadcrumb: self.company_breadcrumb = breadcrumb self._make_clear_breadcrumb()
def test_company_heading(self): # test company_slug = None returns None self.assertIsNone(helpers.bread_box_company_heading(None)) # test company slug w/ valid business unit returns business unit's title company = factories.CompanyFactory() company.company_slug = self.businessunit.title_slug self.assertEqual( helpers.bread_box_company_heading(company.company_slug), self.businessunit.title) # test company slug that does not match a business unit returns the company slug back, but "deslugified" company.company_slug = 'thisslugisntvalid' self.assertEqual( helpers.bread_box_company_heading(company.company_slug), company.company_slug.replace('-', ' ').title()) # extra test to ensure businessunit.title != company_slug self.assertNotEqual( helpers.bread_box_company_heading(company.company_slug), self.businessunit.title)