def test_authentication(self):
        SilkyConfig().SILKY_AUTHENTICATION = True
        response = self.client.get(silky_reverse('requests'))
        self.assertEqual(response.status_code, 302)
        try:
            url = response.url
        except __HOLE__:  # Django 1.5
            url = response['location']
        try:
            # If we run tests within the django_silk project, a login url is available from example_app
            self.assertIn(reverse('login'), url)
        except NoReverseMatch:
            # Otherwise the Django default login url is used, in which case we can test for that instead
            self.assertIn('http://testserver/login/', url)
dataset/ETHPy150Open django-silk/silk/project/tests/test_config_auth.py/TestAuth.test_authentication