Exemple #1
0
    def test_context_processors_absolute(self):
        request = self.factory.get('/')
        context = absolute(request)

        self.assertIn('ABSOLUTE_ROOT', context)
        self.assertIn('ABSOLUTE_ROOT_URL', context)
        self.assertEqual(context['ABSOLUTE_ROOT'], 'http://testserver')
        self.assertEqual(context['ABSOLUTE_ROOT_URL'], 'http://testserver/')
Exemple #2
0
    def test_context_processors_absolute(self):
        request = self.factory.get('/')
        context = absolute(request)

        self.assertIn('ABSOLUTE_ROOT', context)
        self.assertIn('ABSOLUTE_ROOT_URL', context)
        self.assertEqual(context['ABSOLUTE_ROOT'], 'http://testserver')
        self.assertEqual(context['ABSOLUTE_ROOT_URL'], 'http://testserver/')
Exemple #3
0
    def test_context_processors_site(self):
        request = self.factory.get('/')
        context = absolute(request)

        domain = Site.objects.get_current().domain

        self.assertIn('SITE_ROOT', context)
        self.assertIn('SITE_ROOT_URL', context)
        self.assertEqual(context['SITE_ROOT'], 'http://%s' % domain)
        self.assertEqual(context['SITE_ROOT_URL'], 'http://%s/' % domain)
Exemple #4
0
    def test_context_processors_site(self):
        request = self.factory.get('/')
        context = absolute(request)

        domain = Site.objects.get_current().domain

        self.assertIn('SITE_ROOT', context)
        self.assertIn('SITE_ROOT_URL', context)
        self.assertEqual(context['SITE_ROOT'], 'http://%s' % domain)
        self.assertEqual(context['SITE_ROOT_URL'], 'http://%s/' % domain)
Exemple #5
0
    def test_context_processors_site_not_installed(self):
        request = self.factory.get('/')
        context = absolute(request)

        self.assertNotIn('SITE_ROOT', context)
        self.assertNotIn('SITE_ROOT_URL', context)
Exemple #6
0
    def test_context_processors_site_not_installed(self):
        request = self.factory.get('/')
        context = absolute(request)

        self.assertNotIn('SITE_ROOT', context)
        self.assertNotIn('SITE_ROOT_URL', context)