def test_breadcrumbs_from_slugs(self):
        """Tests that breadcrumb URLs aren't mangled on creation from slugs."""
        path = 'deu/jobs/deutsche-bank/careers/'

        self.filters['company_slug'] = 'deutsche-bank'
        self.filters['location_slug'] = 'deu'

        breadbox = Breadbox(path, self.filters, [], QueryDict(''))
        breadbox.build_location_breadcrumbs_from_slugs()

        # Before, the resulting URL would become '[tsche-bank/careers/', which
        # is incorrect, as deu as a slug should be removed, rather than the
        # company name being mangled
        self.assertEqual(breadbox.location_breadcrumbs[0].url,
                         'deutsche-bank/careers/')
Example #2
0
    def test_breadcrumbs_from_slugs(self):
        """Tests that breadcrumb URLs aren't mangled on creation from slugs."""
        path = u"deu/jobs/deutsche-bank/careers/"

        self.filters["company_slug"] = "deutsche-bank"
        self.filters["location_slug"] = "deu"
        query_dict = QueryDict("")

        breadbox = Breadbox(path, self.filters, [], query_dict)
        breadbox.build_location_breadcrumbs_from_slugs()

        # Before, the resulting URL would become '[tsche-bank/careers/', which
        # is incorrect, as deu as a slug should be removed, rather than the
        # company name being mangled
        self.assertEqual(breadbox.location_breadcrumbs[0].url, "deutsche-bank/careers/")

        # location slug not being part of the path shouldn't raise an error
        path = "/jobs/deutsche-bank/careers/"
        breadbox = Breadbox(path, self.filters, [], query_dict)
        breadbox.build_location_breadcrumbs_from_slugs()
Example #3
0
    def test_breadcrumbs_from_slugs(self):
        """Tests that breadcrumb URLs aren't mangled on creation from slugs."""
        path = u'deu/jobs/deutsche-bank/careers/'

        self.filters['company_slug'] = 'deutsche-bank'
        self.filters['location_slug'] = 'deu'
        query_dict = QueryDict('')

        breadbox = Breadbox(path, self.filters, [], query_dict)
        breadbox.build_location_breadcrumbs_from_slugs()

        # Before, the resulting URL would become '[tsche-bank/careers/', which
        # is incorrect, as deu as a slug should be removed, rather than the
        # company name being mangled
        self.assertEqual(breadbox.location_breadcrumbs[0].url,
                         'deutsche-bank/careers/')

        # location slug not being part of the path shouldn't raise an error
        path = '/jobs/deutsche-bank/careers/'
        breadbox = Breadbox(path, self.filters, [], query_dict)
        breadbox.build_location_breadcrumbs_from_slugs()