@mock.patch.object(Site.objects, 'get_current')
    def test_admin_delete_user_with_watched_thread(self, get_current):
        get_current.return_value.domain = 'testserver'

        t = ThreadFactory()
        u = t.creator
        watcher = UserFactory()
        admin_user = UserFactory(is_staff=True, is_superuser=True)

        self.client.login(username=admin_user.username, password='testpass')
        self._toggle_watch_thread_as(t, watcher, turn_on=True)
        url = reverse('admin:auth_user_delete', args=[u.id])
        request = RequestFactory().get(url)
        request.user = admin_user
        request.session = self.client.session
        # The following blows up without our monkeypatch.
        ModelAdmin(User, admin.site).delete_view(request, str(u.id))
Ensure directory d exists (like mkdir -p on Unix)
dataset/ETHPy150Open mozilla/kitsune/kitsune/forums/tests/test_notifications.py/NotificationsTests.test_admin_delete_user_with_watched_thread--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/disk.py/mkdirp