def test_disallowed_redirect(self):
        self.client.login(username="test1", password="password")

        # Get the view
        response = self.client.get(reverse("test_view_crud"))
        self.assertEqual(response.status_code, 200)
        
        # Test create not allowed
        response = self.client.post(reverse("test_view_crud"), {"val": 3})
        add_perm_url = reverse(
            "permissions_url",
            kwargs=dict(
                perm_name="can_add",
                user_ct_id=ContentType.objects.get_for_model(User).id,
                user_id = self.u1.id,
                target_ct_id=ContentType.objects.get_for_model(ContentType).id,
                target_id=ContentType.objects.get_for_model(PermissionTestClass).id,
            )
        ) + "?next=/tests/test_view_crud/"
        self.assertRedirects(response, add_perm_url)
        
        f = PermissionTestClass.objects.all().count()
        self.assertEqual(f, 2,
            "Created object: expected count %s found %s." % (2, f))
@return: True if the processor has been closed.
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/common/permissions/tests/tests.py/TestRequests.test_disallowed_redirect--crossover with--dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/log_processing.py/LogFileProcessor.is_closed