repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/version/__init__.py | tests/version/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/version/tests.py | tests/version/tests.py | from unittest import skipUnless
import django.utils.version
from django import get_version
from django.test import SimpleTestCase
from django.utils.version import (
get_complete_version,
get_git_changeset,
get_version_tuple,
)
class VersionTests(SimpleTestCase):
def test_development(self):
ge... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_filters/models.py | tests/admin_filters/models.py | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Book(models.Model):
title = models.CharField(max_length=50)
year = models.PositiveIntegerF... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_filters/__init__.py | tests/admin_filters/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_filters/tests.py | tests/admin_filters/tests.py | import datetime
import sys
import unittest
from django.contrib.admin import (
AllValuesFieldListFilter,
BooleanFieldListFilter,
EmptyFieldListFilter,
FieldListFilter,
ModelAdmin,
RelatedOnlyFieldListFilter,
SimpleListFilter,
site,
)
from django.contrib.admin.filters import FacetsMixin
f... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/managers_regress/models.py | tests/managers_regress/models.py | """
Various edge-cases for model managers.
"""
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
class OnlyFred(models.Manager):
def get_queryset(self):
return super().get_queryset().fi... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/managers_regress/__init__.py | tests/managers_regress/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/managers_regress/tests.py | tests/managers_regress/tests.py | from django.db import models
from django.template import Context, Template
from django.test import SimpleTestCase, TestCase, override_settings
from django.test.utils import isolate_apps
from .models import (
AbstractBase1,
AbstractBase2,
AbstractBase3,
Child1,
Child2,
Child3,
Child4,
Ch... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_inheritance/test_abstract_inheritance.py | tests/model_inheritance/test_abstract_inheritance.py | from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.core.checks import Error
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db import models
from django.test import SimpleTestCase
from djan... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_inheritance/models.py | tests/model_inheritance/models.py | """
XX. Model inheritance
Model inheritance exists in two varieties:
- abstract base classes which are a way of specifying common
information inherited by the subclasses. They don't exist as a separate
model.
- non-abstract base classes (the default), which are models in their own
right with ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_inheritance/__init__.py | tests/model_inheritance/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_inheritance/tests.py | tests/model_inheritance/tests.py | from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.db import connection, models
from django.db.models.query_utils import DeferredAttribute
from django.test import SimpleTestCase, TestCase
from django.test.utils import CaptureQueriesContext, isolate_apps
from .mo... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/views.py | tests/middleware/views.py | import json
import sys
from django.http import HttpResponse
from django.middleware.csp import get_nonce
from django.utils.csp import CSP
from django.utils.decorators import method_decorator
from django.views.debug import technical_500_response
from django.views.decorators.common import no_append_slash
from django.view... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/cond_get_urls.py | tests/middleware/cond_get_urls.py | from django.http import HttpResponse
from django.urls import path
urlpatterns = [
path("", lambda request: HttpResponse("root is here")),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/test_csp.py | tests/middleware/test_csp.py | import time
from utils_tests.test_csp import basic_config, basic_policy
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import SimpleTestCase
from django.test.selenium import SeleniumTestCase
from django.test.utils import modify_settings, override_settings
from django.utils.cs... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/extra_urls.py | tests/middleware/extra_urls.py | from django.urls import path
from . import views
urlpatterns = [
path("customurlconf/noslash", views.empty_view),
path("customurlconf/slash/", views.empty_view),
path("customurlconf/needsquoting#/", views.empty_view),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/__init__.py | tests/middleware/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/tests.py | tests/middleware/tests.py | import gzip
import random
import re
import struct
import zlib
from io import BytesIO
from unittest import mock
from urllib.parse import quote
from django.conf import settings
from django.core import mail
from django.core.exceptions import PermissionDenied
from django.http import (
FileResponse,
HttpRequest,
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/test_security.py | tests/middleware/test_security.py | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
def middleware(self, *args, **kwargs):
from django.middleware.security import SecurityMiddleware
return Securit... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/middleware/urls.py | tests/middleware/urls.py | from django.urls import path, re_path
from django.views.debug import default_urlconf
from . import views
urlpatterns = [
path("noslash", views.empty_view),
path("slash/", views.empty_view),
path("needsquoting#/", views.empty_view),
# Accepts paths with two leading slashes.
re_path(r"^(.+)/security... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/fixtures/models.py | tests/fixtures/models.py | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/fixtures/__init__.py | tests/fixtures/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/fixtures/tests.py | tests/fixtures/tests.py | import gzip
import os
import sys
import tempfile
import unittest
import warnings
from io import StringIO
from unittest import mock
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.files.temp import NamedTemporaryFile
from django.core.manageme... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_session.py | tests/messages_tests/test_session.py | from django.contrib.messages import Message, constants
from django.contrib.messages.storage.session import SessionStorage
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest
from django.test import TestCase
from django.utils.safestring import SafeData, mark_safe
from .base impor... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/models.py | tests/messages_tests/models.py | from django.db import models
class SomeObject(models.Model):
name = models.CharField(max_length=255)
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_cookie.py | tests/messages_tests/test_cookie.py | import json
import random
from unittest import TestCase
from django.conf import settings
from django.contrib.messages import Message, constants
from django.contrib.messages.storage.cookie import (
CookieStorage,
MessageDecoder,
MessageEncoder,
bisect_keep_left,
bisect_keep_right,
)
from django.test... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/utils.py | tests/messages_tests/utils.py | from django.contrib.messages import Message
class DummyStorage:
"""Dummy message-store to test the API methods."""
def __init__(self):
self.store = []
def add(self, level, message, extra_tags=""):
self.store.append(Message(level, message, extra_tags))
def __iter__(self):
ret... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_middleware.py | tests/messages_tests/test_middleware.py | import unittest
from django.contrib.messages.middleware import MessageMiddleware
from django.http import HttpRequest, HttpResponse
class MiddlewareTests(unittest.TestCase):
def test_response_without_messages(self):
"""
MessageMiddleware is tolerant of messages not existing on request.
"""... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_api.py | tests/messages_tests/test_api.py | from django.contrib import messages
from django.test import RequestFactory, SimpleTestCase
from .utils import DummyStorage
class ApiTests(SimpleTestCase):
rf = RequestFactory()
def setUp(self):
self.request = self.rf.request()
self.storage = DummyStorage()
def test_ok(self):
msg... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/__init__.py | tests/messages_tests/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_mixins.py | tests/messages_tests/test_mixins.py | from django.core.signing import b64_decode
from django.test import TestCase, override_settings
from django.urls import reverse
from .models import SomeObject
from .urls import ContactFormViewWithMsg, DeleteFormViewWithMsg
@override_settings(ROOT_URLCONF="messages_tests.urls")
class SuccessMessageMixinTests(TestCase)... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/tests.py | tests/messages_tests/tests.py | import importlib
import sys
import traceback
import unittest
from unittest import mock
from django.conf import settings
from django.contrib.messages import Message, add_message, constants
from django.contrib.messages.storage import base
from django.contrib.messages.test import MessagesTestMixin
from django.test import... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/test_fallback.py | tests/messages_tests/test_fallback.py | import random
from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import CookieStorage, FallbackStorage
from django.test import SimpleTestCase
from django.utils.crypto import get_random_string
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_m... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/base.py | tests/messages_tests/base.py | from django.contrib.messages import Message, constants, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest, HttpResponse
from django.test ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/messages_tests/urls.py | tests/messages_tests/urls.py | from django import forms
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.template import engines
from django.template.response import TemplateResponse
from django.urls import path, re_path, reverse
f... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_meta/results.py | tests/model_meta/results.py | from .models import AbstractPerson, BasePerson, Person, ProxyPerson, Relating, Relation
TEST_RESULTS = {
"get_all_field_names": {
Person: [
"baseperson_ptr",
"baseperson_ptr_id",
"content_type_abstract",
"content_type_abstract_id",
"content_type_b... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_meta/models.py | tests/model_meta/models.py | from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import gettext_lazy as _
class Relation(models.Model):
pass
class InstanceOnlyDescriptor:
def __get__(self, ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_meta/__init__.py | tests/model_meta/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_meta/tests.py | tests/model_meta/tests.py | from django.apps import apps
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.core.exceptions import FieldDoesNotExist
from django.db.models import CharField, Field, ForeignObjectRel, ManyToManyField
from django.db.models.options import EMPTY_RELATION_TREE, IMMUTABLE_WARNING... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/save_delete_hooks/models.py | tests/save_delete_hooks/models.py | """
Adding hooks before/after saving and deleting
To execute arbitrary code around ``save()`` and ``delete()``, just subclass
the methods.
"""
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=20)
def __init__(s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/save_delete_hooks/__init__.py | tests/save_delete_hooks/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/save_delete_hooks/tests.py | tests/save_delete_hooks/tests.py | from django.test import TestCase
from .models import Person
class SaveDeleteHookTests(TestCase):
def test_basic(self):
p = Person(first_name="John", last_name="Smith")
self.assertEqual(p.data, [])
p.save()
self.assertEqual(
p.data,
[
"Before... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validators/__init__.py | tests/validators/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validators/tests.py | tests/validators/tests.py | import ipaddress
import re
import types
from datetime import datetime, timedelta
from decimal import Decimal
from unittest import TestCase, mock
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.core.validators import (
BaseValidator,
DecimalValidator... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shortcuts/views.py | tests/shortcuts/views.py | from django.shortcuts import render
def render_view(request):
return render(
request,
"shortcuts/render_test.html",
{
"foo": "FOO",
"bar": "BAR",
},
)
def render_view_with_multiple_templates(request):
return render(
request,
[
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shortcuts/__init__.py | tests/shortcuts/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shortcuts/tests.py | tests/shortcuts/tests.py | from django.http.response import HttpResponseRedirectBase
from django.shortcuts import redirect
from django.test import SimpleTestCase, override_settings
from django.test.utils import require_jinja2
@override_settings(ROOT_URLCONF="shortcuts.urls")
class RenderTests(SimpleTestCase):
def test_render(self):
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shortcuts/urls.py | tests/shortcuts/urls.py | from django.urls import path
from . import views
urlpatterns = [
path("render/", views.render_view),
path("render/multiple_templates/", views.render_view_with_multiple_templates),
path("render/content_type/", views.render_view_with_content_type),
path("render/status/", views.render_view_with_status),
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_named_urls.py | tests/urlpatterns_reverse/included_named_urls.py | from django.urls import include, path, re_path
from .views import empty_view
urlpatterns = [
path("", empty_view, name="named-url3"),
re_path(r"^extra/(?P<extra>\w+)/$", empty_view, name="named-url4"),
re_path(r"^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$", empty_view),
path("included/", include("urlpatterns_r... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/no_urls.py | tests/urlpatterns_reverse/no_urls.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/namespace_urls.py | tests/urlpatterns_reverse/namespace_urls.py | from django.urls import include, path, re_path
from . import views
from .utils import URLObject
testobj1 = URLObject("testapp", "test-ns1")
testobj2 = URLObject("testapp", "test-ns2")
default_testobj = URLObject("testapp", "testapp")
otherobj1 = URLObject("nodefault", "other-ns1")
otherobj2 = URLObject("nodefault", ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/erroneous_urls.py | tests/urlpatterns_reverse/erroneous_urls.py | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r"(regex_error/$", views.empty_view),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/views.py | tests/urlpatterns_reverse/views.py | from functools import partial, update_wrapper
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse
from django.urls import reverse_lazy
from django.views.generic import RedirectView, View
def empty_view(request, *args, **kwargs):
return HttpResponse()
def absolute_kw... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/middleware.py | tests/urlpatterns_reverse/middleware.py | from django.http import HttpResponse, StreamingHttpResponse
from django.urls import reverse
from django.utils.deprecation import MiddlewareMixin
from . import urlconf_inner
class ChangeURLconfMiddleware(MiddlewareMixin):
def process_request(self, request):
request.urlconf = urlconf_inner.__name__
class... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_urls2.py | tests/urlpatterns_reverse/included_urls2.py | """
These URL patterns are included in two different ways in the main urls.py, with
an extra argument present in one case. Thus, there are two different ways for
each name to resolve and Django must distinguish the possibilities based on the
argument list.
"""
from django.urls import re_path
from .views import empty_... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_app_urls.py | tests/urlpatterns_reverse/included_app_urls.py | from django.urls import path, re_path
from . import views
app_name = "inc-app"
urlpatterns = [
path("normal/", views.empty_view, name="inc-normal-view"),
re_path(
"^normal/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$",
views.empty_view,
name="inc-normal-view",
),
re_path(r"^\+\\\$\*/$",... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/nested_urls.py | tests/urlpatterns_reverse/nested_urls.py | from django.urls import include, path
from django.views import View
def view1(request):
pass
def view2(request):
pass
class View3(View):
pass
nested = (
[
path("view1/", view1, name="view1"),
path("view3/", View3.as_view(), name="view3"),
],
"backend",
)
urlpatterns = [
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_named_urls2.py | tests/urlpatterns_reverse/included_named_urls2.py | from django.urls import path, re_path
from .views import empty_view
urlpatterns = [
path("", empty_view, name="named-url5"),
re_path(r"^extra/(?P<extra>\w+)/$", empty_view, name="named-url6"),
re_path(r"^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$", empty_view),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urlconf_inner.py | tests/urlpatterns_reverse/urlconf_inner.py | from django.http import HttpResponse
from django.template import Context, Template
from django.urls import path
def inner_view(request):
content = Template(
'{% url "outer" as outer_url %}outer:{{ outer_url }},'
'{% url "inner" as inner_url %}inner:{{ inner_url }}'
).render(Context())
retu... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/extra_urls.py | tests/urlpatterns_reverse/extra_urls.py | """
Some extra URL patterns that are included at the top level.
"""
from django.urls import include, path, re_path
from .views import empty_view
urlpatterns = [
re_path("^e-places/([0-9]+)/$", empty_view, name="extra-places"),
re_path(r"^e-people/(?P<name>\w+)/$", empty_view, name="extra-people"),
path("... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/utils.py | tests/urlpatterns_reverse/utils.py | from django.urls import path, re_path
from . import views
class URLObject:
urlpatterns = [
path("inner/", views.empty_view, name="urlobject-view"),
re_path(
r"^inner/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$",
views.empty_view,
name="urlobject-view",
),
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/named_urls.py | tests/urlpatterns_reverse/named_urls.py | from django.urls import include, path, re_path
from .views import empty_view
urlpatterns = [
path("", empty_view, name="named-url1"),
re_path(r"^extra/(?P<extra>\w+)/$", empty_view, name="named-url2"),
re_path(r"^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$", empty_view),
path("included/", include("urlpatterns_r... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urls_without_handlers.py | tests/urlpatterns_reverse/urls_without_handlers.py | # A URLconf that doesn't define any handlerXXX.
from django.urls import path
from .views import bad_view, empty_view
urlpatterns = [
path("test_view/", empty_view, name="test_view"),
path("bad_view/", bad_view, name="bad_view"),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_namespace_urls.py | tests/urlpatterns_reverse/included_namespace_urls.py | from django.urls import include, path, re_path
from .utils import URLObject
from .views import empty_view, view_class_instance
testobj3 = URLObject("testapp", "test-ns3")
testobj4 = URLObject("testapp", "test-ns4")
app_name = "included_namespace_urls"
urlpatterns = [
path("normal/", empty_view, name="inc-normal-... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/reverse_lazy_urls.py | tests/urlpatterns_reverse/reverse_lazy_urls.py | from django.urls import path
from .views import LazyRedirectView, empty_view, login_required_view
urlpatterns = [
path("redirected_to/", empty_view, name="named-lazy-url-redirected-to"),
path("login/", empty_view, name="some-login-page"),
path("login_required_view/", login_required_view),
path("redire... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urlconf_outer.py | tests/urlpatterns_reverse/urlconf_outer.py | from django.urls import include, path
from . import urlconf_inner
urlpatterns = [
path("test/me/", urlconf_inner.inner_view, name="outer"),
path("inner_urlconf/", include(urlconf_inner.__name__)),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_urls.py | tests/urlpatterns_reverse/included_urls.py | from django.urls import path, re_path
from .views import empty_view
urlpatterns = [
path("", empty_view, name="inner-nothing"),
re_path(r"extra/(?P<extra>\w+)/$", empty_view, name="inner-extra"),
re_path(r"(?P<one>[0-9]+)|(?P<two>[0-9]+)/$", empty_view, name="inner-disjunction"),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urls_error_handlers.py | tests/urlpatterns_reverse/urls_error_handlers.py | # Used by the ErrorHandlerResolutionTests test case.
urlpatterns = []
handler400 = "urlpatterns_reverse.views.empty_view"
handler403 = "urlpatterns_reverse.views.empty_view"
handler404 = "urlpatterns_reverse.views.empty_view"
handler500 = "urlpatterns_reverse.views.empty_view"
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/__init__.py | tests/urlpatterns_reverse/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/named_urls_conflict.py | tests/urlpatterns_reverse/named_urls_conflict.py | from django.urls import path, re_path
from .views import empty_view
urlpatterns = [
# No kwargs
path("conflict/cannot-go-here/", empty_view, name="name-conflict"),
path("conflict/", empty_view, name="name-conflict"),
# One kwarg
re_path(r"^conflict-first/(?P<first>\w+)/$", empty_view, name="name-c... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/tests.py | tests/urlpatterns_reverse/tests.py | """
Unit tests for reverse URL lookups.
"""
import pickle
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.http import (
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/views_broken.py | tests/urlpatterns_reverse/views_broken.py | # I just raise an AttributeError to confuse the view loading mechanism
raise AttributeError("I am here to confuse django.urls.get_callable")
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/test_localeregexdescriptor.py | tests/urlpatterns_reverse/test_localeregexdescriptor.py | import os
from pathlib import Path
from unittest import mock
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, override_settings
from django.urls.resolvers import LocaleRegexDescriptor, RegexPattern
from django.utils import translation
here = os.path.dirname(os.path.abspa... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urls_error_handlers_callables.py | tests/urlpatterns_reverse/urls_error_handlers_callables.py | # Used by the ErrorHandlerResolutionTests test case.
from .views import empty_view
urlpatterns = []
handler400 = empty_view
handler403 = empty_view
handler404 = empty_view
handler500 = empty_view
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/included_no_kwargs_urls.py | tests/urlpatterns_reverse/included_no_kwargs_urls.py | from django.urls import re_path
from .views import empty_view
urlpatterns = [
re_path("^inner-no-kwargs/([0-9]+)/$", empty_view, name="inner-no-kwargs")
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/method_view_urls.py | tests/urlpatterns_reverse/method_view_urls.py | from django.urls import path
class ViewContainer:
def method_view(self, request):
pass
@classmethod
def classmethod_view(cls, request):
pass
view_container = ViewContainer()
urlpatterns = [
path("", view_container.method_view, name="instance-method-url"),
path("", ViewContaine... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/nonimported_module.py | tests/urlpatterns_reverse/nonimported_module.py | def view(request):
"""Stub view"""
pass
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/urls.py | tests/urlpatterns_reverse/urls.py | from django.urls import include, path, re_path
from .views import (
absolute_kwargs_view,
defaults_view,
empty_view,
empty_view_nested_partial,
empty_view_partial,
empty_view_wrapped,
nested_view,
view_func_from_cbv,
)
other_patterns = [
path("non_path_include/", empty_view, name="... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/translations/__init__.py | tests/urlpatterns_reverse/translations/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/translations/locale/__init__.py | tests/urlpatterns_reverse/translations/locale/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/translations/locale/de/__init__.py | tests/urlpatterns_reverse/translations/locale/de/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urlpatterns_reverse/translations/locale/fr/__init__.py | tests/urlpatterns_reverse/translations/locale/fr/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_formsets_regress/models.py | tests/model_formsets_regress/models.py | from django.db import models
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, models.CASCADE, to_field="username")
data = models.IntegerField()
class UserProfile(models.Mode... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_formsets_regress/__init__.py | tests/model_formsets_regress/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_formsets_regress/tests.py | tests/model_formsets_regress/tests.py | from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet,
inlineformset_factory,
modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from django.test import TestCase
from .mo... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/select_related_regress/models.py | tests/select_related_regress/models.py | from django.db import models
class Building(models.Model):
name = models.CharField(max_length=10)
class Device(models.Model):
building = models.ForeignKey("Building", models.CASCADE)
name = models.CharField(max_length=10)
class Port(models.Model):
device = models.ForeignKey("Device", models.CASCAD... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/select_related_regress/__init__.py | tests/select_related_regress/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/select_related_regress/tests.py | tests/select_related_regress/tests.py | from django.test import TestCase
from .models import (
A,
B,
Building,
C,
Chick,
Child,
Class,
Client,
ClientStatus,
Connection,
Country,
Device,
Enrollment,
Hen,
Item,
Organizer,
Person,
Port,
SpecialClient,
State,
Student,
TUser,... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_models.py | tests/invalid_models_tests/test_models.py | import unittest
from django.core.checks import Error, Warning
from django.core.checks.model_checks import _check_lazy_references
from django.db import connection, connections, models
from django.db.models.functions import Abs, Lower, Round
from django.db.models.signals import post_init
from django.test import SimpleTe... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_custom_fields.py | tests/invalid_models_tests/test_custom_fields.py | from django.db import models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps
@isolate_apps("invalid_models_tests")
class CustomFieldTest(SimpleTestCase):
def test_none_column(self):
class NoColumnField(models.AutoField):
def db_type(self, connection):
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_backend_specific.py | tests/invalid_models_tests/test_backend_specific.py | from unittest import mock
from django.core.checks import Error
from django.db import connections, models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps
def dummy_allow_migrate(db, app_label, **hints):
# Prevent checks from being run on the 'other' database, which doesn't have
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_deprecated_fields.py | tests/invalid_models_tests/test_deprecated_fields.py | from unittest import skipUnless
from django.core import checks
from django.db import connection, models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps, modify_settings
@isolate_apps("invalid_models_tests")
class DeprecatedFieldsTests(SimpleTestCase):
def test_IPAddressField_dep... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_ordinary_fields.py | tests/invalid_models_tests/test_ordinary_fields.py | import unittest
import uuid
from django.core.checks import Error
from django.core.checks import Warning as DjangoWarning
from django.db import connection, models
from django.db.models.functions import Coalesce, LPad, Pi
from django.test import SimpleTestCase, TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/__init__.py | tests/invalid_models_tests/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/invalid_models_tests/test_relative_fields.py | tests/invalid_models_tests/test_relative_fields.py | from unittest import mock
from django.core.checks import Error
from django.core.checks import Warning as DjangoWarning
from django.db import connection, models
from django.test import skipUnlessDBFeature
from django.test.testcases import SimpleTestCase, TestCase
from django.test.utils import isolate_apps, modify_setti... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/basic/models.py | tests/basic/models.py | import uuid
from django.db import models
class Article(models.Model):
headline = models.CharField(max_length=100, default="Default headline")
pub_date = models.DateTimeField()
class Meta:
ordering = ("pub_date", "headline")
def __str__(self):
return self.headline
class FeaturedArt... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/basic/__init__.py | tests/basic/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/basic/tests.py | tests/basic/tests.py | import inspect
import threading
import time
from datetime import datetime, timedelta
from unittest import mock
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import (
DEFAULT_DB_ALIAS,
DatabaseError,
connection,
connections,
models,
transaction,
)
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/string_lookup/models.py | tests/string_lookup/models.py | from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
class Bar(models.Model):
name = models.CharField(max_length=50)
normal = models.ForeignKey(Foo, models.CASCADE, related_name="normal_foo")
fwd = model... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/string_lookup/__init__.py | tests/string_lookup/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.