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/gis_tests/geoapp/sitemaps.py | tests/gis_tests/geoapp/sitemaps.py | from django.contrib.gis.sitemaps import KMLSitemap, KMZSitemap
from .models import City, Country
sitemaps = {
"kml": KMLSitemap([City, Country]),
"kmz": KMZSitemap([City, Country]),
}
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/test_functions.py | tests/gis_tests/geoapp/test_functions.py | import json
import math
import re
from decimal import Decimal
from django.contrib.gis.db.models import GeometryField, PolygonField, functions
from django.contrib.gis.geos import (
GEOSGeometry,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
fromstr,
)
from django... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/models.py | tests/gis_tests/geoapp/models.py | from django.contrib.gis.db import models
from ..utils import gisfield_may_be_null
class NamedModel(models.Model):
name = models.CharField(max_length=30)
class Meta:
abstract = True
def __str__(self):
return self.name
class Country(NamedModel):
mpoly = models.MultiPolygonField() #... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/test_feeds.py | tests/gis_tests/geoapp/test_feeds.py | from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .models import City
@modify_settings(INSTALLED_APPS={"append": "django.contrib.sites"})
@override_settings(ROOT_URLCONF="gis_tests.geoap... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/test_sitemaps.py | tests/gis_tests/geoapp/test_sitemaps.py | import zipfile
from io import BytesIO
from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .models import City, Country
@modify_settings(
INSTALLED_APPS={"append": ["django.contrib.site... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/__init__.py | tests/gis_tests/geoapp/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/test_indexes.py | tests/gis_tests/geoapp/test_indexes.py | from django.contrib.gis.db import models
from django.db import connection
from django.db.models import Index
from django.test import TransactionTestCase
from django.test.utils import isolate_apps
from .models import City
class SchemaIndexesTests(TransactionTestCase):
available_apps = []
models = [City]
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/tests.py | tests/gis_tests/geoapp/tests.py | from io import StringIO
from unittest import skipIf
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union, functions
from django.contrib.gis.geos import (
GeometryCollection,
GEOSGeometry,
LinearRing,
LineString,
MultiLineString,
MultiPoint,
Mu... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/test_serializers.py | tests/gis_tests/geoapp/test_serializers.py | import json
from django.contrib.gis.geos import LinearRing, Point, Polygon
from django.core import serializers
from django.test import TestCase
from .models import City, MultiFields, PennsylvaniaCity
class GeoJSONSerializerTests(TestCase):
fixtures = ["initial"]
def test_builtin_serializers(self):
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/feeds.py | tests/gis_tests/geoapp/feeds.py | from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = "/city/"
title = "Test GeoDjango Cities"
def items(self):
return City.objects.all()
def item_link(self, item):
return "/city/%s/" % item.pk
def item_geometry(self, item):
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoapp/urls.py | tests/gis_tests/geoapp/urls.py | from django.contrib.gis import views as gis_views
from django.contrib.gis.sitemaps import views as gis_sitemap_views
from django.contrib.sitemaps import views as sitemap_views
from django.urls import path
from .feeds import feed_dict
from .sitemaps import sitemaps
urlpatterns = [
path("feeds/<path:url>/", gis_vie... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/test_operations.py | tests/gis_tests/gis_migrations/test_operations.py | from unittest import skipUnless
from django.contrib.gis.db.models import fields
from django.contrib.gis.geos import MultiPolygon, Polygon
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migr... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/__init__.py | tests/gis_tests/gis_migrations/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/test_commands.py | tests/gis_tests/gis_migrations/test_commands.py | from django.core.management import call_command
from django.db import connection
from django.test import TransactionTestCase
class MigrateTests(TransactionTestCase):
"""
Tests running the migrate command in GeoDjango.
"""
available_apps = ["gis_tests.gis_migrations"]
def get_table_description(se... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/migrations/0001_setup_extensions.py | tests/gis_tests/gis_migrations/migrations/0001_setup_extensions.py | from django.db import connection, migrations
if connection.features.supports_raster:
from django.contrib.postgres.operations import CreateExtension
class Migration(migrations.Migration):
operations = [
CreateExtension("postgis_raster"),
]
else:
class Migration(migrations.Migr... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/migrations/__init__.py | tests/gis_tests/gis_migrations/migrations/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gis_migrations/migrations/0002_create_models.py | tests/gis_tests/gis_migrations/migrations/0002_create_models.py | from django.contrib.gis.db import models
from django.db import connection, migrations
ops = [
migrations.CreateModel(
name="Neighborhood",
fields=[
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/data/__init__.py | tests/gis_tests/data/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/data/rasters/__init__.py | tests/gis_tests/data/rasters/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/data/rasters/textrasters.py | tests/gis_tests/data/rasters/textrasters.py | """
Text-based test rasters
"""
JSON_RASTER = """{
"srid": 4326,
"origin": [0, 0],
"scale": [-1, 1],
"skew": [0, 0],
"width": 5,
"height": 5,
"nr_of_bands": 1,
"bands": [{"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 2... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/field_subclassing/fields.py | tests/field_subclassing/fields.py | from django.db import models
from django.db.models.query_utils import DeferredAttribute
class CustomTypedField(models.TextField):
def db_type(self, connection):
return "custom_field"
class CustomDeferredAttribute(DeferredAttribute):
def __get__(self, instance, cls=None):
self._count_call(ins... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/field_subclassing/__init__.py | tests/field_subclassing/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/field_subclassing/tests.py | tests/field_subclassing/tests.py | from django.db import connection, models
from django.test import SimpleTestCase
from .fields import CustomDescriptorField, CustomTypedField
class TestDbType(SimpleTestCase):
def test_db_parameters_respects_db_type(self):
f = CustomTypedField()
self.assertEqual(f.db_parameters(connection)["type"],... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/signed_cookies_tests/__init__.py | tests/signed_cookies_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/signed_cookies_tests/tests.py | tests/signed_cookies_tests/tests.py | from datetime import timedelta
from django.core import signing
from django.http import HttpRequest, HttpResponse
from django.test import SimpleTestCase, override_settings
from django.test.utils import freeze_time
class SignedCookieTest(SimpleTestCase):
def test_can_set_and_read_signed_cookies(self):
resp... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shell/models.py | tests/shell/models.py | from django.db import models
class Marker(models.Model):
pass
class Phone(models.Model):
name = models.CharField(max_length=50)
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shell/__init__.py | tests/shell/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/shell/tests.py | tests/shell/tests.py | import os
import subprocess
import sys
import unittest
from unittest import mock
from django import __version__
from django.conf import settings
from django.contrib.auth.models import Group, Permission, User
from django.contrib.contenttypes.models import ContentType
from django.core.management import CommandError, cal... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/schema/test_logging.py | tests/schema/test_logging.py | from django.db import connection
from django.test import TestCase
class SchemaLoggerTests(TestCase):
def test_extra_args(self):
editor = connection.schema_editor(collect_sql=True)
sql = "SELECT * FROM foo WHERE id in (%s, %s)"
params = [42, 1337]
with self.assertLogs("django.db.bac... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/schema/models.py | tests/schema/models.py | from django.apps.registry import Apps
from django.db import models
# Because we want to test creation and deletion of these as separate things,
# these models are all inserted into a separate Apps so the main test
# runner doesn't migrate them.
new_apps = Apps()
class Author(models.Model):
name = models.CharFie... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/schema/fields.py | tests/schema/fields.py | from functools import partial
from django.db import models
from django.db.models.fields.related import (
RECURSIVE_RELATIONSHIP_CONSTANT,
ManyToManyDescriptor,
RelatedField,
create_many_to_many_intermediary_model,
)
class CustomManyToManyField(RelatedField):
"""
Ticket #24104 - Need to have a... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/schema/__init__.py | tests/schema/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/schema/tests.py | tests/schema/tests.py | import datetime
import itertools
import unittest
from copy import copy
from decimal import Decimal
from unittest import mock
from django.core.exceptions import FieldError
from django.core.management.color import no_style
from django.core.serializers.json import DjangoJSONEncoder
from django.db import (
DatabaseErr... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/indexes/models.py | tests/indexes/models.py | from django.db import models
class CurrentTranslation(models.ForeignObject):
"""
Creates virtual relation to the translation with model cache enabled.
"""
# Avoid validation
requires_unique_target = False
def __init__(self, to, on_delete, from_fields, to_fields, **kwargs):
# Disable ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/indexes/__init__.py | tests/indexes/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/indexes/tests.py | tests/indexes/tests.py | import datetime
from unittest import skipUnless
from django.conf import settings
from django.db import connection
from django.db.models import CASCADE, CharField, ForeignKey, Index, Q
from django.db.models.functions import Lower
from django.test import (
TestCase,
TransactionTestCase,
skipIfDBFeature,
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/test_mysql.py | tests/dbshell/test_mysql.py | import os
import signal
import subprocess
import sys
from pathlib import Path
from unittest import mock, skipUnless
from django.db import connection
from django.db.backends.mysql.client import DatabaseClient
from django.test import SimpleTestCase
class MySqlDbshellCommandTestCase(SimpleTestCase):
def settings_to... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/test_postgresql.py | tests/dbshell/test_postgresql.py | import os
import signal
import subprocess
import sys
from pathlib import Path
from unittest import mock, skipUnless
from django.db import connection
from django.db.backends.postgresql.client import DatabaseClient
from django.test import SimpleTestCase
class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
def s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/__init__.py | tests/dbshell/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/tests.py | tests/dbshell/tests.py | from unittest import mock
from django.core.management import call_command
from django.core.management.base import CommandError
from django.db import connection
from django.test import SimpleTestCase
class DbshellCommandTestCase(SimpleTestCase):
def test_command_missing(self):
msg = (
"You app... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/test_sqlite.py | tests/dbshell/test_sqlite.py | import subprocess
from pathlib import Path
from unittest import mock, skipUnless
from django.core.management import CommandError, call_command
from django.db import connection
from django.db.backends.sqlite3.client import DatabaseClient
from django.test import SimpleTestCase
class SqliteDbshellCommandTestCase(Simple... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/fake_client.py | tests/dbshell/fake_client.py | import sys
sys.exit(1)
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/dbshell/test_oracle.py | tests/dbshell/test_oracle.py | from unittest import mock, skipUnless
from django.db import connection
from django.db.backends.oracle.client import DatabaseClient
from django.test import SimpleTestCase
@skipUnless(connection.vendor == "oracle", "Requires oracledb to be installed")
class OracleDbshellTests(SimpleTestCase):
def settings_to_cmd_a... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/defer/models.py | tests/defer/models.py | """
Tests for defer() and only().
"""
from django.db import models
class Secondary(models.Model):
first = models.CharField(max_length=50)
second = models.CharField(max_length=50)
class Primary(models.Model):
name = models.CharField(max_length=50)
value = models.CharField(max_length=50)
related ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/defer/__init__.py | tests/defer/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/defer/tests.py | tests/defer/tests.py | from django.core.exceptions import FieldDoesNotExist, FieldError, FieldFetchBlocked
from django.db.models import FETCH_PEERS, RAISE
from django.test import SimpleTestCase, TestCase
from .models import (
BigChild,
Child,
ChildProxy,
Primary,
PrimaryOneToOne,
RefreshPrimaryProxy,
Secondary,
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/datetimes/models.py | tests/datetimes/models.py | from django.db import models
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateTimeField()
published_on = models.DateField(null=True)
categories = models.ManyToManyField("Category", related_name="articles")
def __str__(self):
return self.title
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/datetimes/__init__.py | tests/datetimes/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/datetimes/tests.py | tests/datetimes/tests.py | import datetime
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Article, Category, Comment
class DateTimesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=dat... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/field_deconstruction/__init__.py | tests/field_deconstruction/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/field_deconstruction/tests.py | tests/field_deconstruction/tests.py | from django.apps import apps
from django.db import models
from django.test import SimpleTestCase, override_settings
from django.test.utils import isolate_lru_cache
from django.utils.choices import normalize_choices
class FieldDeconstructionTests(SimpleTestCase):
"""
Tests the deconstruct() method on all core ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/models.py | tests/user_commands/models.py | """
User-registered management commands
The ``manage.py`` utility provides a number of useful commands for managing a
Django project. If you want to add a utility command of your own, you can.
The user-defined command ``dance`` is defined in the management/commands
subdirectory of this test application. It is a simpl... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/utils.py | tests/user_commands/utils.py | from io import StringIO
from unittest import mock
class AssertFormatterFailureCaughtContext:
def __init__(self, test, shutil_which_result="nonexistent"):
self.stdout = StringIO()
self.stderr = StringIO()
self.test = test
self.shutil_which_result = shutil_which_result
def __en... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/__init__.py | tests/user_commands/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/tests.py | tests/user_commands/tests.py | import os
import sys
import unittest
from argparse import ArgumentDefaultsHelpFormatter
from io import BytesIO, StringIO, TextIOWrapper
from pathlib import Path
from unittest import mock
from admin_scripts.tests import AdminScriptTestCase
from django.apps import apps
from django.core import management
from django.cor... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/urls.py | tests/user_commands/urls.py | from django.urls import path
urlpatterns = [
path("some/url/", lambda req: req, name="some_url"),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/__init__.py | tests/user_commands/management/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/subparser.py | tests/user_commands/management/commands/subparser.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
subparsers = parser.add_subparsers()
parser_foo = subparsers.add_parser("foo")
parser_foo.add_argument("bar", type=int)
def handle(self, *args, **options):
self.std... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/hal.py | tests/user_commands/management/commands/hal.py | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Useless command."
def add_arguments(self, parser):
parser.add_argument(
"args",
metavar="app_label",
nargs="*",
help="Specify the app label(s) to works... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/required_list_option.py | tests/user_commands/management/commands/required_list_option.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("--foo-list", nargs="+", type=int, required=True)
def handle(self, *args, **options):
for option, value in options.items():
self.stdout.write("%s=%s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/specific_system_checks.py | tests/user_commands/management/commands/specific_system_checks.py | from django.core.checks import Tags
from django.core.management.base import BaseCommand
class Command(BaseCommand):
requires_system_checks = [Tags.staticfiles, Tags.models]
def handle(self, *args, **options):
pass
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/subparser_required.py | tests/user_commands/management/commands/subparser_required.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
subparsers_1 = parser.add_subparsers(dest="subcommand_1")
parser_foo_1 = subparsers_1.add_parser("foo_1")
subparsers_2 = parser_foo_1.add_subparsers(dest="subcommand_2")
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/outputwrapper.py | tests/user_commands/management/commands/outputwrapper.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, **options):
self.stdout.write("Working...")
self.stdout.flush()
self.stdout.write("OK")
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/no_translations.py | tests/user_commands/management/commands/no_translations.py | from django.core.management.base import BaseCommand, no_translations
from django.utils import translation
class Command(BaseCommand):
@no_translations
def handle(self, *args, **options):
return translation.get_language()
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/reverse_url.py | tests/user_commands/management/commands/reverse_url.py | from django.core.management.base import BaseCommand
from django.urls import reverse
class Command(BaseCommand):
"""
This command returns a URL from a reverse() call.
"""
def handle(self, *args, **options):
return reverse("some_url")
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/set_option.py | tests/user_commands/management/commands/set_option.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("--set")
def handle(self, **options):
self.stdout.write("Set %s" % options["set"])
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/required_option.py | tests/user_commands/management/commands/required_option.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("-n", "--need-me", required=True)
parser.add_argument("-t", "--need-me-too", required=True, dest="needme2")
def handle(self, *args, **options):
self.std... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/common_args.py | tests/user_commands/management/commands/common_args.py | from argparse import ArgumentError
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
def add_arguments(self, parser):
try:
parser.add_argument("--version", action="version", version="A.B.C")
except ArgumentError:
pass
els... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/no_system_checks.py | tests/user_commands/management/commands/no_system_checks.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
requires_system_checks = []
def handle(self, *args, **options):
pass
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/dance.py | tests/user_commands/management/commands/dance.py | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Dance around like a madman."
args = ""
requires_system_checks = "__all__"
def add_arguments(self, parser):
parser.add_argument("integer", nargs="?", type=int, default=0)
parser.add_ar... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/transaction.py | tests/user_commands/management/commands/transaction.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Say hello."
args = ""
output_transaction = True
def handle(self, *args, **options):
return "Hello!"
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/required_constant_option.py | tests/user_commands/management/commands/required_constant_option.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
"--append_const",
action="append_const",
const=42,
required=True,
)
parser.add_argument("--const", action="s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/__init__.py | tests/user_commands/management/commands/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/mutually_exclusive_required_with_same_dest.py | tests/user_commands/management/commands/mutually_exclusive_required_with_same_dest.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--for", dest="until", action="store")
group.add_argument("--until", action="store")
def handl... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/subparser_dest.py | tests/user_commands/management/commands/subparser_dest.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
subparsers = parser.add_subparsers(dest="subcommand", required=True)
parser_foo = subparsers.add_parser("foo")
parser_foo.add_argument("--bar")
def handle(self, *args, **op... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/subparser_vanilla.py | tests/user_commands/management/commands/subparser_vanilla.py | import argparse
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
subparsers = parser.add_subparsers(parser_class=argparse.ArgumentParser)
parser_foo = subparsers.add_parser("foo")
parser_foo.add_argument("bar", type=int)
... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/user_commands/management/commands/mutually_exclusive_required.py | tests/user_commands/management/commands/mutually_exclusive_required.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--foo-id", type=int, nargs="?", default=None)
group.add_argument("--foo-name", type=str, nargs="?"... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/model_enums/__init__.py | tests/model_enums/__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_enums/tests.py | tests/model_enums/tests.py | import datetime
import decimal
import ipaddress
import uuid
from django.db import models
from django.template import Context, Template
from django.test import SimpleTestCase
from django.utils.functional import Promise
from django.utils.translation import gettext_lazy as _
class Suit(models.IntegerChoices):
DIAMO... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/test_simpletestcase.py | tests/test_utils/test_simpletestcase.py | import unittest
from io import StringIO
from unittest import mock
from unittest.suite import _DebugResult
from django.test import SimpleTestCase
class ErrorTestCase(SimpleTestCase):
def raising_test(self):
self._pre_setup.assert_called_once_with()
raise Exception("debug() bubbles up exceptions be... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/test_testcase.py | tests/test_utils/test_testcase.py | import pickle
from functools import wraps
from django.db import IntegrityError, connections, transaction
from django.test import TestCase, skipUnlessDBFeature
from django.test.testcases import (
DatabaseOperationForbidden,
SimpleTestCase,
TestData,
is_pickable,
)
from .models import Car, Person, Posse... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/views.py | tests/test_utils/views.py | from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.template import Context, Template
from .models import Person
def get_person(request, pk):
person = get_object_or_404(Person, pk=pk)
return HttpResponse(person.name)
def no_template_used(request):
template = ... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/test_serializemixin.py | tests/test_utils/test_serializemixin.py | from django.test import SimpleTestCase
from django.test.testcases import SerializeMixin
class TestSerializeMixin(SimpleTestCase):
def test_init_without_lockfile(self):
msg = (
"ExampleTests.lockfile isn't set. Set it to a unique value in the "
"base class."
)
with s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/models.py | tests/test_utils/models.py | from django.db import models
class Car(models.Model):
name = models.CharField(max_length=100)
class Person(models.Model):
name = models.CharField(max_length=100)
cars = models.ManyToManyField(Car, through="PossessedCar")
data = models.BinaryField(null=True)
class PossessedCar(models.Model):
ca... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/__init__.py | tests/test_utils/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/tests.py | tests/test_utils/tests.py | import os
import sys
import threading
import traceback
import unittest
import warnings
from functools import partial
from io import StringIO
from unittest import mock
from django.conf import STATICFILES_STORAGE_ALIAS, settings
from django.contrib.staticfiles.finders import get_finder, get_finders
from django.contrib.s... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/test_transactiontestcase.py | tests/test_utils/test_transactiontestcase.py | from unittest import mock
from django.db import connections
from django.test import TestCase, TransactionTestCase, override_settings
from django.test.testcases import DatabaseOperationForbidden
from .models import Car, Person
class TestSerializedRollbackInhibitsPostMigrate(TransactionTestCase):
"""
Transact... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/test_utils/urls.py | tests/test_utils/urls.py | from django.urls import path
from . import views
urlpatterns = [
path("test_utils/get_person/<int:pk>/", views.get_person),
path(
"test_utils/no_template_used/", views.no_template_used, name="no_template_used"
),
]
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/humanize_tests/__init__.py | tests/humanize_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/humanize_tests/tests.py | tests/humanize_tests/tests.py | import datetime
from decimal import Decimal
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import SimpleTestCase, modify_settings, override_settings
from django.utils import translation
from django.utils.html import escape
from d... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/views.py | tests/file_uploads/views.py | import hashlib
import os
from django.core.files.uploadedfile import UploadedFile
from django.core.files.uploadhandler import TemporaryFileUploadHandler
from django.http import HttpResponse, HttpResponseServerError, JsonResponse
from .models import FileModel
from .tests import UNICODE_FILENAME, UPLOAD_FOLDER
from .upl... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/models.py | tests/file_uploads/models.py | from django.db import models
class FileModel(models.Model):
testfile = models.FileField(upload_to="test_upload")
| python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/__init__.py | tests/file_uploads/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/tests.py | tests/file_uploads/tests.py | import base64
import hashlib
import os
import shutil
import sys
import tempfile as sys_tempfile
import unittest
from io import BytesIO, StringIO
from unittest import mock
from urllib.parse import quote
from django.conf import DEFAULT_STORAGE_ALIAS
from django.core.exceptions import SuspiciousFileOperation
from django.... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | true |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/uploadhandler.py | tests/file_uploads/uploadhandler.py | """
Upload handlers to test the upload API.
"""
import os
from tempfile import NamedTemporaryFile
from django.core.files.uploadhandler import (
FileUploadHandler,
StopUpload,
TemporaryFileUploadHandler,
)
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the co... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_uploads/urls.py | tests/file_uploads/urls.py | from django.urls import path, re_path
from . import views
urlpatterns = [
path("upload/", views.file_upload_view),
path("upload_traversal/", views.file_upload_traversal_view),
path("verify/", views.file_upload_view_verify),
path("unicode_name/", views.file_upload_unicode_name),
path("echo/", views... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/responses/test_fileresponse.py | tests/responses/test_fileresponse.py | import io
import itertools
import os
import sys
import tempfile
from unittest import skipIf
from django.core.files.base import ContentFile
from django.http import FileResponse
from django.test import SimpleTestCase
class UnseekableBytesIO(io.BytesIO):
def seekable(self):
return False
class FileResponse... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/responses/test_cookie.py | tests/responses/test_cookie.py | import time
from datetime import UTC, date, datetime, timedelta
from email.utils import format_datetime as format_datetime_rfc5322
from http import cookies
from django.http import HttpResponse
from django.test import SimpleTestCase
from django.test.utils import freeze_time
from django.utils.http import http_date
cla... | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/responses/__init__.py | tests/responses/__init__.py | python | BSD-3-Clause | 3201a895cba335000827b28768a7b7105c81b415 | 2026-01-04T14:38:15.489092Z | false | |
django/django | https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/responses/tests.py | tests/responses/tests.py | import io
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse
from django.http.response import HttpResponseBase
from django.test import SimpleTestCase
UTF8 = "utf-8"
ISO88591 = "iso-8859-1"
class HttpResponseBaseTests(SimpleTestCase):
def test_closed(self):
... | 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.