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/django/conf/locale/da/__init__.py
django/conf/locale/da/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/locale/sl/formats.py
django/conf/locale/sl/formats.py
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "d. F Y" TIME_FORMAT = "H:i" DATETIME_FORMAT = "j. F Y. H:i" YEAR_MONTH_FORMAT = "F Y" MONTH_DAY_FOR...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/locale/sl/__init__.py
django/conf/locale/sl/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/locale/et/formats.py
django/conf/locale/et/formats.py
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "j. F Y" TIME_FORMAT = "G:i" # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = "j. F" SHO...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/locale/et/__init__.py
django/conf/locale/et/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/urls/i18n.py
django/conf/urls/i18n.py
import functools from django.conf import settings from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path from django.views.i18n import set_language def i18n_patterns(*urls, prefix_default_language=True): """ Add the language code prefix to every URL pattern within this function. Thi...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/urls/__init__.py
django/conf/urls/__init__.py
from django.urls import include from django.views import defaults __all__ = ["handler400", "handler403", "handler404", "handler500", "include"] handler400 = defaults.bad_request handler403 = defaults.permission_denied handler404 = defaults.page_not_found handler500 = defaults.server_error
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/conf/urls/static.py
django/conf/urls/static.py
import re from urllib.parse import urlsplit from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.urls import re_path from django.views.static import serve def static(prefix, view=serve, **kwargs): """ Return a URL pattern for serving files in debug mode. f...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/converters.py
django/urls/converters.py
import functools import uuid class IntConverter: regex = "[0-9]+" def to_python(self, value): return int(value) def to_url(self, value): return str(value) class StringConverter: regex = "[^/]+" def to_python(self, value): return value def to_url(self, value): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/resolvers.py
django/urls/resolvers.py
""" This module converts requested URLs to callback view functions. URLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ import functools import inspect import re import string from ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/exceptions.py
django/urls/exceptions.py
from django.http import Http404 class Resolver404(Http404): pass class NoReverseMatch(Exception): pass
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/utils.py
django/urls/utils.py
import functools from importlib import import_module from django.core.exceptions import ViewDoesNotExist from django.utils.module_loading import module_has_submodule @functools.cache def get_callable(lookup_view): """ Return a callable corresponding to lookup_view. * If lookup_view is already a callable,...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/__init__.py
django/urls/__init__.py
from .base import ( clear_script_prefix, clear_url_caches, get_script_prefix, get_urlconf, is_valid_path, resolve, reverse, reverse_lazy, set_script_prefix, set_urlconf, translate_url, ) from .conf import include, path, re_path from .converters import register_converter from ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/base.py
django/urls/base.py
from urllib.parse import unquote, urlencode, urlsplit, urlunsplit from asgiref.local import Local from django.http import QueryDict from django.utils.functional import lazy from django.utils.translation import override from .exceptions import NoReverseMatch, Resolver404 from .resolvers import _get_cached_resolver, g...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/urls/conf.py
django/urls/conf.py
"""Functions for use in URLsconfs.""" from functools import partial from importlib import import_module from django.core.exceptions import ImproperlyConfigured from .resolvers import ( LocalePrefixPattern, RegexPattern, RoutePattern, URLPattern, URLResolver, ) def include(arg, namespace=None): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/http/response.py
django/http/response.py
import datetime import io import json import mimetypes import os import re import sys import time import warnings from email.header import Header from http.client import responses from urllib.parse import urlsplit from asgiref.sync import async_to_sync, sync_to_async from django.conf import settings from django.core ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/http/cookie.py
django/http/cookie.py
from http import cookies # For backwards compatibility in Django 2.1. SimpleCookie = cookies.SimpleCookie def parse_cookie(cookie): """ Return a dictionary parsed from a `Cookie:` header string. """ cookiedict = {} for chunk in cookie.split(";"): if "=" in chunk: key, val = ch...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/http/request.py
django/http/request.py
import codecs import copy import operator from io import BytesIO from itertools import chain from urllib.parse import parse_qsl, quote, urlencode, urljoin, urlsplit from django.conf import settings from django.core import signing from django.core.exceptions import ( BadRequest, DisallowedHost, ImproperlyCo...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/http/__init__.py
django/http/__init__.py
from django.http.cookie import SimpleCookie, parse_cookie from django.http.request import ( HttpHeaders, HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, ) from django.http.response import ( BadHeaderError, FileResponse, Http404, HttpResponse, HttpResponseBadReq...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/django/http/multipartparser.py
django/http/multipartparser.py
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import base64 import binascii import collections import html from django.conf import settings from django.core.exceptions import ( RequestDataTooBig, ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/runtests.py
tests/runtests.py
#!/usr/bin/env python import argparse import atexit import copy import gc import multiprocessing import os import shutil import socket import subprocess import sys import tempfile import warnings from pathlib import Path try: import django except ImportError as e: raise RuntimeError( "Django module not...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/sitecustomize.py
tests/sitecustomize.py
try: import coverage except ImportError: pass else: coverage.process_startup()
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_sqlite.py
tests/test_sqlite.py
# This is an example test settings file for use with the Django test suite. # # The 'sqlite3' backend requires only the ENGINE setting (an in- # memory database will be used). All other backends will require a # NAME and potentially authentication information. See the # following section in the docs for more informatio...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/urls.py
tests/urls.py
"""This URLconf exists because Django expects ROOT_URLCONF to exist. URLs should be added within the test folders, and use TestCase.urls to set them. This helps the tests remain isolated. """ urlpatterns = []
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_unique.py
tests/validation/test_unique.py
import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrorsModel, UniqueFieldsMo...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_picklable.py
tests/validation/test_picklable.py
import pickle from unittest import TestCase from django.core.exceptions import ValidationError class PickableValidationErrorTestCase(TestCase): def test_validationerror_is_picklable(self): original = ValidationError("a", code="something") unpickled = pickle.loads(pickle.dumps(original)) s...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_error_messages.py
tests/validation/test_error_messages.py
from unittest import TestCase from django.core.exceptions import ValidationError from django.db import models class ValidationMessagesTest(TestCase): def _test_validation_messages(self, field, value, expected): with self.assertRaises(ValidationError) as cm: field.clean(value, None) se...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/models.py
tests/validation/models.py
from datetime import datetime from django.core.exceptions import ValidationError from django.db import models from django.db.models.functions import Lower def validate_answer_to_universe(value): if value != 42: raise ValidationError( "This is not the answer to life, universe and everything!",...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_custom_messages.py
tests/validation/test_custom_messages.py
from django.test import SimpleTestCase from . import ValidationAssertions from .models import CustomMessagesModel class CustomMessagesTests(ValidationAssertions, SimpleTestCase): def test_custom_simple_validator_message(self): cmm = CustomMessagesModel(number=12) self.assertFieldFailsValidationWi...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/__init__.py
tests/validation/__init__.py
from django.core.exceptions import ValidationError class ValidationAssertions: def assertFailsValidation(self, clean, failed_fields, **kwargs): with self.assertRaises(ValidationError) as cm: clean(**kwargs) self.assertEqual(sorted(failed_fields), sorted(cm.exception.message_dict)) ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/tests.py
tests/validation/tests.py
from django import forms from django.core.exceptions import NON_FIELD_ERRORS from django.test import TestCase from django.utils.functional import lazy from . import ValidationAssertions from .models import ( Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqueTest, ModelToValidate,...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_constraints.py
tests/validation/test_constraints.py
from django.core.exceptions import ValidationError from django.test import TestCase, skipUnlessDBFeature from .models import ( ChildProduct, ChildUniqueConstraintProduct, Product, UniqueConstraintConditionProduct, UniqueConstraintProduct, ) class PerformConstraintChecksTest(TestCase): @skipUn...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/validation/test_validators.py
tests/validation/test_validators.py
from django.test import SimpleTestCase from . import ValidationAssertions from .models import ModelToValidate class TestModelsWithValidators(ValidationAssertions, SimpleTestCase): def test_custom_validator_passes_for_correct_value(self): mtv = ModelToValidate( number=10, name="Som...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/requests_tests/test_accept_header.py
tests/requests_tests/test_accept_header.py
from unittest import TestCase from django.http import HttpRequest from django.http.request import MediaType class MediaTypeTests(TestCase): def test_empty(self): for empty_media_type in (None, "", " "): with self.subTest(media_type=empty_media_type): media_type = MediaType(em...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/requests_tests/test_data_upload_settings.py
tests/requests_tests/test_data_upload_settings.py
from io import BytesIO from django.core.exceptions import ( RequestDataTooBig, TooManyFieldsSent, TooManyFilesSent, ) from django.core.handlers.wsgi import WSGIRequest from django.test import SimpleTestCase from django.test.client import FakePayload TOO_MANY_FIELDS_MSG = ( "The number of GET/POST para...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/requests_tests/__init__.py
tests/requests_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/requests_tests/tests.py
tests/requests_tests/tests.py
import copy from io import BytesIO from itertools import chain from urllib.parse import urlencode from django.core.exceptions import BadRequest, DisallowedHost from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.files.uploadhandler import MemoryFileUploadHandler from django.core.handlers.w...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/empty/models.py
tests/empty/models.py
""" Empty model tests These test that things behave sensibly for the rare corner-case of a model with no fields. """ from django.db import models class Empty(models.Model): pass
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/empty/__init__.py
tests/empty/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/empty/tests.py
tests/empty/tests.py
from django.test import TestCase from .models import Empty class EmptyModelTests(TestCase): def test_empty(self): m = Empty() self.assertIsNone(m.id) m.save() Empty.objects.create() self.assertEqual(len(Empty.objects.all()), 2) self.assertIsNotNone(m.id) ex...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/empty/no_models/__init__.py
tests/empty/no_models/__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_autodiscover/admin.py
tests/admin_autodiscover/admin.py
from django.contrib import admin from .models import Story admin.site.register(Story) raise Exception("Bad admin module")
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_autodiscover/models.py
tests/admin_autodiscover/models.py
from django.db import models class Story(models.Model): title = models.CharField(max_length=10)
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_autodiscover/__init__.py
tests/admin_autodiscover/__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_autodiscover/tests.py
tests/admin_autodiscover/tests.py
from django.contrib import admin from django.test import SimpleTestCase class AdminAutoDiscoverTests(SimpleTestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_double_call_autodiscover(self)...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/tasks.py
tests/tasks/tasks.py
import time from django.tasks import TaskContext, task @task() def noop_task(*args, **kwargs): return None @task def noop_task_from_bare_decorator(*args, **kwargs): return None @task() async def noop_task_async(*args, **kwargs): return None @task() def calculate_meaning_of_life(): return 42 @...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/test_tasks.py
tests/tasks/test_tasks.py
import dataclasses from datetime import datetime from django.tasks import ( DEFAULT_TASK_QUEUE_NAME, TaskResultStatus, default_task_backend, task, task_backends, ) from django.tasks.backends.dummy import DummyBackend from django.tasks.backends.immediate import ImmediateBackend from django.tasks.bas...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/test_custom_backend.py
tests/tasks/test_custom_backend.py
import logging from unittest import mock from django.tasks import default_task_backend, task_backends from django.tasks.backends.base import BaseTaskBackend from django.tasks.exceptions import InvalidTask from django.test import SimpleTestCase, override_settings from . import tasks as test_tasks class CustomBackend...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/test_dummy_backend.py
tests/tasks/test_dummy_backend.py
from typing import cast from unittest import mock from django.db import transaction from django.tasks import TaskResultStatus, default_task_backend, task_backends from django.tasks.backends.dummy import DummyBackend from django.tasks.base import Task from django.tasks.exceptions import InvalidTask, TaskResultDoesNotEx...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/__init__.py
tests/tasks/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/tasks/test_immediate_backend.py
tests/tasks/test_immediate_backend.py
from django.db import transaction from django.tasks import TaskResultStatus, default_task_backend, task_backends from django.tasks.backends.immediate import ImmediateBackend from django.tasks.exceptions import InvalidTask from django.test import SimpleTestCase, TransactionTestCase, override_settings from django.utils i...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_checks.py
tests/composite_pk/test_checks.py
from django.core import checks from django.db import connection, models from django.db.models import F from django.test import TestCase, skipUnlessAnyDBFeature from django.test.utils import isolate_apps @isolate_apps("composite_pk") class CompositePKChecksTests(TestCase): maxDiff = None def test_composite_pk...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_get.py
tests/composite_pk/test_get.py
from django.test import TestCase from .models import Comment, Tenant, TimeStamped, User class CompositePKGetTests(TestCase): maxDiff = None @classmethod def setUpTestData(cls): cls.tenant_1 = Tenant.objects.create() cls.tenant_2 = Tenant.objects.create() cls.user_1 = User.objects...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_delete.py
tests/composite_pk/test_delete.py
from django.test import TestCase from .models import Comment, Tenant, User class CompositePKDeleteTests(TestCase): maxDiff = None @classmethod def setUpTestData(cls): cls.tenant_1 = Tenant.objects.create() cls.tenant_2 = Tenant.objects.create() cls.user_1 = User.objects.create( ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_names_to_path.py
tests/composite_pk/test_names_to_path.py
from django.db.models.query_utils import PathInfo from django.db.models.sql import Query from django.test import TestCase from .models import Comment, Tenant, User class NamesToPathTests(TestCase): def test_id(self): query = Query(User) path, final_field, targets, rest = query.names_to_path(["id"...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_models.py
tests/composite_pk/test_models.py
from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.test import TestCase from .models import Comment, Tenant, Token, User class CompositePKModelsTests(TestCase): @classmethod def setUpTestData(cls): cls.tenant_1 = Tenant.objects.cr...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_create.py
tests/composite_pk/test_create.py
from django.db import IntegrityError from django.test import TestCase, skipUnlessDBFeature from .models import Post, Tenant, User class CompositePKCreateTests(TestCase): maxDiff = None @classmethod def setUpTestData(cls): cls.tenant = Tenant.objects.create(id=1) cls.user = User.objects.c...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_filter.py
tests/composite_pk/test_filter.py
from unittest.mock import patch from django.db import NotSupportedError, connection from django.db.models import ( Case, F, FilteredRelation, OuterRef, Q, Subquery, TextField, Value, When, ) from django.db.models.functions import Cast from django.db.models.lookups import Exact from ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/__init__.py
tests/composite_pk/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/tests.py
tests/composite_pk/tests.py
import json import unittest from uuid import UUID try: import yaml # NOQA HAS_YAML = True except ImportError: HAS_YAML = False from django import forms from django.core import serializers from django.core.exceptions import FieldDoesNotExist, FieldError from django.db import IntegrityError, connection fr...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_values.py
tests/composite_pk/test_values.py
from collections import namedtuple from uuid import UUID from django.test import TestCase from .models import Comment, Post, Tenant, User class CompositePKValuesTests(TestCase): USER_1_EMAIL = "user0001@example.com" USER_2_EMAIL = "user0002@example.com" USER_3_EMAIL = "user0003@example.com" POST_1_I...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_order_by.py
tests/composite_pk/test_order_by.py
from django.db.models import F from django.test import TestCase from .models import Comment, Tenant, User class CompositePKOrderByTests(TestCase): maxDiff = None @classmethod def setUpTestData(cls): cls.tenant_1 = Tenant.objects.create() cls.tenant_2 = Tenant.objects.create() cls...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_update.py
tests/composite_pk/test_update.py
from django.core.exceptions import FieldError from django.db import connection from django.db.models import F from django.test import TestCase from .models import Comment, Tenant, TimeStamped, Token, User class CompositePKUpdateTests(TestCase): maxDiff = None @classmethod def setUpTestData(cls): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/test_aggregate.py
tests/composite_pk/test_aggregate.py
from django.db.models import Count, Max, Q from django.test import TestCase from .models import Comment, Tenant, User class CompositePKAggregateTests(TestCase): @classmethod def setUpTestData(cls): cls.tenant_1 = Tenant.objects.create() cls.tenant_2 = Tenant.objects.create() cls.user_...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/models/tenant.py
tests/composite_pk/models/tenant.py
import uuid from django.db import models class Tenant(models.Model): name = models.CharField(max_length=10, default="", blank=True) class Token(models.Model): pk = models.CompositePrimaryKey("tenant_id", "id") tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE, related_name="tokens") id = ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/composite_pk/models/__init__.py
tests/composite_pk/models/__init__.py
from .tenant import Comment, Post, Tenant, TimeStamped, Token, User __all__ = [ "Comment", "Post", "Tenant", "TimeStamped", "Token", "User", ]
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_common.py
tests/decorators/test_common.py
from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.views.decorators.common import no_append_slash class NoAppendSlashTests(SimpleTestCase): def test_wrapped_sync_function_is_not_coroutine_function(self): def sy...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_csp.py
tests/decorators/test_csp.py
from itertools import product from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.utils.csp import CSP from django.views.decorators.csp import csp_override, csp_report_only_override basic_config = { "default-src": [CSP....
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_http.py
tests/decorators/test_http.py
import datetime from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse, HttpResponseNotAllowed from django.test import SimpleTestCase from django.views.decorators.http import ( condition, conditional_page, require_http_methods, require_safe, ) class RequireHtt...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_cache.py
tests/decorators/test_cache.py
from unittest import mock from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_control, cache_page, never_cache class HttpRequestProxy...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_csrf.py
tests/decorators/test_csrf.py
from asgiref.sync import iscoroutinefunction from django.conf import settings from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.views.decorators.csrf import ( csrf_exempt, csrf_protect, ensure_csrf_cookie, requires_csrf_token, ) CSRF_TOKEN = "1bcdefgh...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_gzip.py
tests/decorators/test_gzip.py
from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.views.decorators.gzip import gzip_page class GzipPageTests(SimpleTestCase): # Gzip ignores content that is too short. content = "Content " * 100 def test_wrap...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_vary.py
tests/decorators/test_vary.py
from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.test import SimpleTestCase from django.views.decorators.vary import vary_on_cookie, vary_on_headers class VaryOnHeadersTests(SimpleTestCase): def test_wrapped_sync_function_is_not_coroutine_function(self): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/__init__.py
tests/decorators/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/tests.py
tests/decorators/tests.py
import asyncio from functools import update_wrapper, wraps from unittest import TestCase from asgiref.sync import iscoroutinefunction from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test, ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/decorators/test_clickjacking.py
tests/decorators/test_clickjacking.py
from asgiref.sync import iscoroutinefunction from django.http import HttpRequest, HttpResponse from django.middleware.clickjacking import XFrameOptionsMiddleware from django.test import SimpleTestCase from django.views.decorators.clickjacking import ( xframe_options_deny, xframe_options_exempt, xframe_opti...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/m2m_through/models.py
tests/m2m_through/models.py
from datetime import datetime from django.db import models # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ("name",) class PersonChild(Person): pass class Group(models.Model): name = models.CharField(max_leng...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/m2m_through/__init__.py
tests/m2m_through/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/m2m_through/tests.py
tests/m2m_through/tests.py
from datetime import date, datetime, timedelta from operator import attrgetter from django.db import IntegrityError from django.test import TestCase from .models import ( CustomMembership, Employee, Event, Friendship, Group, Ingredient, Invitation, Membership, Person, PersonChi...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_changelist/test_date_hierarchy.py
tests/admin_changelist/test_date_hierarchy.py
from datetime import datetime from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.auth.models import User from django.test import RequestFactory, TestCase, override_settings from django.urls import reverse from django.utils.timezone import make_aware from .admin import EventAdmin fr...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_changelist/admin.py
tests/admin_changelist/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.core.paginator import Paginator from .models import Band, Child, Event, Genre, GrandChild, Parent, ProxyUser, Swallow site = admin.AdminSite(name="admin") site.register(User, UserA...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_changelist/models.py
tests/admin_changelist/models.py
import uuid from django.contrib.auth.models import User from django.db import models class Event(models.Model): # Oracle can have problems with a column named "date" date = models.DateField(db_column="event_date") class Parent(models.Model): name = models.CharField(max_length=128) class Child(models....
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_changelist/__init__.py
tests/admin_changelist/__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_changelist/tests.py
tests/admin_changelist/tests.py
import datetime from unittest import mock from django.contrib import admin from django.contrib.admin.models import LogEntry from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminSeleniumTestCase...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_changelist/urls.py
tests/admin_changelist/urls.py
from django.urls import path from . import admin urlpatterns = [ path("admin/", admin.site.urls), ]
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/from_db_value/models.py
tests/from_db_value/models.py
import decimal from django.db import models class Cash(decimal.Decimal): currency = "USD" class CashField(models.DecimalField): def __init__(self, **kwargs): kwargs["max_digits"] = 20 kwargs["decimal_places"] = 2 super().__init__(**kwargs) def from_db_value(self, value, express...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/from_db_value/__init__.py
tests/from_db_value/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/from_db_value/tests.py
tests/from_db_value/tests.py
from django.db import connection from django.db.models import Max from django.test import TestCase from .models import Cash, CashModel class FromDBValueTest(TestCase): @classmethod def setUpTestData(cls): CashModel.objects.create(cash="12.50") def test_simple_load(self): instance = CashM...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/views.py
tests/generic_views/views.py
from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.urls import reverse, reverse_lazy from django.utils.decorators import method_decorator from django.views import generic from .forms import AuthorForm, ConfirmDeleteForm, ContactForm from .models import Art...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/test_list.py
tests/generic_views/test_list.py
import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings from django.views.generic.base import View from .models import Artist, Author, Book, Page @override_settings(ROOT_URLCONF="generic_views.urls") class ListViewTests(TestCase): @classmethod ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/test_base.py
tests/generic_views/test_base.py
import logging import time from logging_tests.tests import LoggingAssertionMixin from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_jinja2 from django.urls import r...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/models.py
tests/generic_views/models.py
from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.urls import reverse class Artist(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ["name"] verbose_name = "professional artist" ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/test_detail.py
tests/generic_views/test_detail.py
import datetime from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.views.generic.base import View from django.views.generic.detail import SingleObjectTemplateResponseMixin from django....
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/test_edit.py
tests/generic_views/test_edit.py
from django import forms from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase, TestCase, override_settings from django.test.client import RequestFactory from django.urls import reverse from django.views.generic.base import View from django.views.generic.edit import CreateView, ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/__init__.py
tests/generic_views/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/forms.py
tests/generic_views/forms.py
from django import forms from .models import Author class AuthorForm(forms.ModelForm): name = forms.CharField() slug = forms.SlugField() class Meta: model = Author fields = ["name", "slug"] class ContactForm(forms.Form): name = forms.CharField() message = forms.CharField(widget...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/urls.py
tests/generic_views/urls.py
from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required from django.urls import path, re_path from django.views.decorators.cache import cache_page from django.views.generic import TemplateView, dates from . import views from .models import Book urlpatterns = [ ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/generic_views/test_dates.py
tests/generic_views/test_dates.py
import datetime from unittest import mock from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import requires_tz_support from .models import Artist, Author, Book, BookSigning, Page def _make_books(n, base_date): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/extra_regress/models.py
tests/extra_regress/models.py
import copy import datetime from django.contrib.auth.models import User from django.db import models class RevisionableModel(models.Model): base = models.ForeignKey("self", models.SET_NULL, null=True) title = models.CharField(blank=True, max_length=255) when = models.DateTimeField(default=datetime.dateti...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/extra_regress/__init__.py
tests/extra_regress/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false