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/template_tests/syntax_tests/test_querystring.py
tests/template_tests/syntax_tests/test_querystring.py
from django.http import QueryDict from django.template import RequestContext from django.template.base import TemplateSyntaxError from django.test import RequestFactory, SimpleTestCase from ..utils import setup class QueryStringTagTests(SimpleTestCase): request_factory = RequestFactory() def assertRenderEq...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_for.py
tests/template_tests/syntax_tests/test_for.py
from django.template import TemplateSyntaxError from django.template.defaulttags import ForNode from django.test import SimpleTestCase from ..utils import setup class ForTagTests(SimpleTestCase): libraries = {"custom": "template_tests.templatetags.custom"} @setup({"for-tag01": "{% for val in values %}{{ val...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_partials.py
tests/template_tests/syntax_tests/test_partials.py
from django.template import ( Context, TemplateDoesNotExist, TemplateSyntaxError, VariableDoesNotExist, ) from django.template.base import Token, TokenType from django.test import SimpleTestCase from django.views.debug import ExceptionReporter from ..utils import setup partial_templates = { "parti...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_debug.py
tests/template_tests/syntax_tests/test_debug.py
from django.contrib.auth.models import Group from django.test import SimpleTestCase, override_settings from ..utils import setup @override_settings(DEBUG=True) class DebugTests(SimpleTestCase): @override_settings(DEBUG=False) @setup({"non_debug": "{% debug %}"}) def test_non_debug(self): output =...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_exceptions.py
tests/template_tests/syntax_tests/test_exceptions.py
from django.template import Template, TemplateDoesNotExist, TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup from .test_extends import inheritance_templates class ExceptionsTests(SimpleTestCase): @setup({"exception01": "{% extends 'nonexistent' %}"}) def test_exception01(s...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_resetcycle.py
tests/template_tests/syntax_tests/test_resetcycle.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class ResetCycleTagTests(SimpleTestCase): @setup({"resetcycle01": "{% resetcycle %}"}) def test_resetcycle01(self): with self.assertRaisesMessage(TemplateSyntaxError, "No cycles in templat...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_spaceless.py
tests/template_tests/syntax_tests/test_spaceless.py
from django.test import SimpleTestCase from ..utils import setup class SpacelessTagTests(SimpleTestCase): @setup( { "spaceless01": ( "{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}" ) } ) def test_spaceless01(self): output =...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_with.py
tests/template_tests/syntax_tests/test_with.py
from django.template import TemplateSyntaxError from django.template.defaulttags import WithNode from django.test import SimpleTestCase from ..utils import setup class WithTagTests(SimpleTestCase): at_least_with_one_msg = "'with' expected at least one variable assignment" @setup({"with01": "{% with key=dict...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_basic.py
tests/template_tests/syntax_tests/test_basic.py
from django.template.base import Origin, Template, TemplateSyntaxError from django.template.context import Context from django.template.loader_tags import BlockContext, BlockNode from django.test import SimpleTestCase from django.views.debug import ExceptionReporter from ..utils import SilentAttrClass, SilentGetItemCl...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_simple_tag.py
tests/template_tests/syntax_tests/test_simple_tag.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class SimpleTagTests(SimpleTestCase): libraries = {"custom": "template_tests.templatetags.custom"} @setup({"simpletag-renamed01": "{% load custom %}{% minusone 7 %}"}) def test_simpletag_rena...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/test_template_tag.py
tests/template_tests/syntax_tests/test_template_tag.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class TemplateTagTests(SimpleTestCase): @setup({"templatetag01": "{% templatetag openblock %}"}) def test_templatetag01(self): output = self.engine.render_to_string("templatetag01") ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_underscore_syntax.py
tests/template_tests/syntax_tests/i18n/test_underscore_syntax.py
from django.template import Context, Template from django.test import SimpleTestCase from django.utils import translation from ...utils import setup from .base import MultipleLocaleActivationTestCase class MultipleLocaleActivationTests(MultipleLocaleActivationTestCase): def test_single_locale_activation(self): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_get_available_languages.py
tests/template_tests/syntax_tests/i18n/test_get_available_languages.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ...utils import setup class GetAvailableLanguagesTagTests(SimpleTestCase): libraries = {"i18n": "django.templatetags.i18n"} @setup( { "i18n12": "{% load i18n %}" "{% get_available_lang...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_translate.py
tests/template_tests/syntax_tests/i18n/test_translate.py
import inspect from functools import partial, wraps from asgiref.local import Local from django.template import Context, Template, TemplateSyntaxError from django.templatetags.l10n import LocalizeNode from django.test import SimpleTestCase, override_settings from django.utils import translation from django.utils.safe...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py
tests/template_tests/syntax_tests/i18n/test_blocktranslate.py
import inspect import os from functools import partial, wraps from asgiref.local import Local from django.template import Context, Template, TemplateSyntaxError from django.template.base import Token, TokenType from django.templatetags.i18n import BlockTranslateNode from django.test import SimpleTestCase, override_se...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/__init__.py
tests/template_tests/syntax_tests/i18n/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_filters.py
tests/template_tests/syntax_tests/i18n/test_filters.py
from django.test import SimpleTestCase from django.utils import translation from ...utils import setup class I18nFiltersTests(SimpleTestCase): libraries = { "custom": "template_tests.templatetags.custom", "i18n": "django.templatetags.i18n", } @setup( { "i18n32": '{% l...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/base.py
tests/template_tests/syntax_tests/i18n/base.py
import os from django.conf import settings from django.test import SimpleTestCase from django.utils.translation import activate, get_language here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) pdir = os.path.split(os.path.split(os.path.abspath(here))[0])[0] extended_locale_paths = settings.LOCALE_PATH...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py
tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import translation from ...utils import setup class GetLanguageInfoListTests(SimpleTestCase): libraries = { "custom": "template_tests.templatetags.custom", "i18n": "django.templatetags.i18n", ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_language.py
tests/template_tests/syntax_tests/i18n/test_language.py
from template_tests.utils import setup from django.template import TemplateSyntaxError from django.test import SimpleTestCase class I18nLanguageTagTests(SimpleTestCase): libraries = {"i18n": "django.templatetags.i18n"} @setup({"i18n_language": "{% load i18n %} {% language %} {% endlanguage %}"}) def tes...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_get_current_language.py
tests/template_tests/syntax_tests/i18n/test_get_current_language.py
from template_tests.utils import setup from django.template import TemplateSyntaxError from django.test import SimpleTestCase class I18nGetCurrentLanguageTagTests(SimpleTestCase): libraries = {"i18n": "django.templatetags.i18n"} @setup({"template": "{% load i18n %} {% get_current_language %}"}) def test...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_get_current_language_bidi.py
tests/template_tests/syntax_tests/i18n/test_get_current_language_bidi.py
from template_tests.utils import setup from django.template import TemplateSyntaxError from django.test import SimpleTestCase class I18nGetCurrentLanguageBidiTagTests(SimpleTestCase): libraries = {"i18n": "django.templatetags.i18n"} @setup({"template": "{% load i18n %} {% get_current_language_bidi %}"}) ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/template_tests/syntax_tests/i18n/test_get_language_info.py
tests/template_tests/syntax_tests/i18n/test_get_language_info.py
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import translation from ...utils import setup class I18nGetLanguageInfoTagTests(SimpleTestCase): libraries = { "custom": "template_tests.templatetags.custom", "i18n": "django.templatetags.i18n...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_custom_urls/models.py
tests/admin_custom_urls/models.py
from functools import update_wrapper from django.contrib import admin from django.db import models from django.http import HttpResponseRedirect from django.urls import reverse class Action(models.Model): name = models.CharField(max_length=50, primary_key=True) description = models.CharField(max_length=70) ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_custom_urls/__init__.py
tests/admin_custom_urls/__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_custom_urls/tests.py
tests/admin_custom_urls/tests.py
from django.contrib.admin.utils import quote from django.contrib.admin.views.main import IS_POPUP_VAR from django.contrib.auth.models import User from django.template.response import TemplateResponse from django.test import TestCase, override_settings from django.urls import reverse from .models import Action, Car, Pe...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/admin_custom_urls/urls.py
tests/admin_custom_urls/urls.py
from django.urls import path from .models import site urlpatterns = [ path("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/select_related_onetoone/models.py
tests/select_related_onetoone/models.py
from django.db import models class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() class UserProfile(models.Model): user = models.OneToOneField(User, models.CASCADE) city = models.CharField(max_length=100) state = models.CharField(max_length=2) class...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/select_related_onetoone/__init__.py
tests/select_related_onetoone/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/select_related_onetoone/tests.py
tests/select_related_onetoone/tests.py
from django.core.exceptions import FieldError from django.db.models import FilteredRelation from django.test import SimpleTestCase, TestCase from .models import ( AdvancedUserStat, Child1, Child2, Child3, Child4, Image, LinkedList, Parent1, Parent2, Product, StatDetails, ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/db_utils/__init__.py
tests/db_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/db_utils/tests.py
tests/db_utils/tests.py
"""Tests for django.db.utils.""" import unittest from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS, ProgrammingError, connection from django.db.utils import ConnectionHandler, load_backend from django.test import SimpleTestCase, TestCase from django.utils.connection import...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/test_generate_filename.py
tests/file_storage/test_generate_filename.py
import os from django.core.exceptions import SuspiciousFileOperation from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage, Storage from django.db.models import FileField from django.test import SimpleTestCase class AWSS3Storage(Storage): """ Simulate an AWS S...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/test_base.py
tests/file_storage/test_base.py
import os from unittest import mock from django.core.exceptions import SuspiciousFileOperation from django.core.files.storage import Storage from django.test import SimpleTestCase class CustomStorage(Storage): """Simple Storage subclass implementing the bare minimum for testing.""" def exists(self, name): ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/models.py
tests/file_storage/models.py
""" Storing files according to a custom storage system ``FileField`` and its variations can take a ``storage`` argument to specify how and where files should be stored. """ import random import tempfile from pathlib import Path from django.core.files.storage import FileSystemStorage, default_storage from django.db i...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/test_inmemory_storage.py
tests/file_storage/test_inmemory_storage.py
import os import sys import time import unittest from django.core.files.base import ContentFile from django.core.files.storage import InMemoryStorage from django.core.files.uploadedfile import TemporaryUploadedFile from django.test import SimpleTestCase, override_settings class MemoryStorageIOTests(unittest.TestCase...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/__init__.py
tests/file_storage/__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_storage/tests.py
tests/file_storage/tests.py
import datetime import os import shutil import sys import tempfile import threading import time import unittest from io import StringIO from pathlib import Path from urllib.request import urlopen from django.conf import DEFAULT_STORAGE_ALIAS, STATICFILES_STORAGE_ALIAS from django.core.cache import cache from django.co...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/file_storage/urls.py
tests/file_storage/urls.py
from django.http import HttpResponse from django.urls import path urlpatterns = [ path("", lambda req: HttpResponse("example view")), ]
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/update_only_fields/models.py
tests/update_only_fields/models.py
from django.db import models class Account(models.Model): num = models.IntegerField() class Person(models.Model): GENDER_CHOICES = ( ("M", "Male"), ("F", "Female"), ) name = models.CharField(max_length=20) gender = models.CharField(max_length=1, choices=GENDER_CHOICES) pid = ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/update_only_fields/__init__.py
tests/update_only_fields/__init__.py
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/update_only_fields/tests.py
tests/update_only_fields/tests.py
from django.core.exceptions import ObjectNotUpdated from django.db import DatabaseError, connection, transaction from django.db.models import F from django.db.models.signals import post_save, pre_save from django.test import TestCase from .models import Account, Employee, Person, Profile, ProxyEmployee class UpdateO...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_data.py
tests/gis_tests/test_data.py
""" This module has the mock object definitions used to hold reference geometry for the GEOS and GDAL tests. """ import json import os from django.utils.functional import cached_property # Path where reference test data is located. TEST_DATA = os.path.join(os.path.dirname(__file__), "data") def tuplize(seq): "...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_geoip2.py
tests/gis_tests/test_geoip2.py
import ipaddress import itertools import pathlib from unittest import mock, skipUnless from django.conf import settings from django.contrib.gis.geoip2 import HAS_GEOIP2 from django.contrib.gis.geos import GEOSGeometry from django.test import SimpleTestCase, override_settings if HAS_GEOIP2: import geoip2 from...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/admin.py
tests/gis_tests/admin.py
try: from django.contrib.gis import admin except ImportError: from django.contrib import admin admin.GISModelAdmin = admin.ModelAdmin
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_spatialrefsys.py
tests/gis_tests/test_spatialrefsys.py
import re from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.functional import cached_property test_srs = ( { "srid": 4326, "auth_name": ("EPSG", True), "auth_sri...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_measure.py
tests/gis_tests/test_measure.py
""" Distance and Area objects to allow for sensible and convenient calculation and conversions. Here are some tests. """ import unittest from django.contrib.gis.measure import A, Area, D, Distance from django.test import SimpleTestCase class DistanceTest(SimpleTestCase): "Testing the Distance object" def t...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/models.py
tests/gis_tests/models.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/test_ptr.py
tests/gis_tests/test_ptr.py
import ctypes from unittest import mock from django.contrib.gis.ptr import CPointerBase from django.test import SimpleTestCase class CPointerBaseTests(SimpleTestCase): def test(self): destructor_mock = mock.Mock() class NullPointerException(Exception): pass class FakeGeom1(C...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/utils.py
tests/gis_tests/utils.py
import copy import unittest from functools import wraps from unittest import mock from django.conf import settings from django.contrib.gis.geos.libgeos import geos_version_tuple from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import Func def skipUnlessGISLookup(*gis_lookups): """ Ski...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_geoforms.py
tests/gis_tests/test_geoforms.py
import re from django.contrib.gis import forms from django.contrib.gis.forms import BaseGeometryWidget, OpenLayersWidget from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import ValidationError from django.template.defaultfilters import json_script from django.test import SimpleTestCase, ove...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_gis_tests_utils.py
tests/gis_tests/test_gis_tests_utils.py
from django.db import connection, models from django.test import SimpleTestCase from .utils import FuncTestMixin def test_mutation(raises=True): def wrapper(mutation_func): def test(test_case_instance, *args, **kwargs): class TestFunc(models.Func): output_field = models.Intege...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/test_fields.py
tests/gis_tests/test_fields.py
import copy from django.contrib.gis.db.models import GeometryField from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.test import SimpleTestCase class FieldsTests(SimpleTestCase): def test_area_field_deepcopy(self): field = AreaField(None) self.assertEqual(copy.deep...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/__init__.py
tests/gis_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/gis_tests/tests.py
tests/gis_tests/tests.py
import unittest from django.core.exceptions import ImproperlyConfigured from django.db import ProgrammingError, connection from django.db.backends.base.base import NO_DB_ALIAS from django.test import TestCase try: from django.contrib.gis.db.backends.postgis.operations import PostGISOperations HAS_POSTGRES = ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geo3d/views.py
tests/gis_tests/geo3d/views.py
# Create your views here.
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geo3d/models.py
tests/gis_tests/geo3d/models.py
from django.contrib.gis.db import models class NamedModel(models.Model): name = models.CharField(max_length=30) class Meta: abstract = True def __str__(self): return self.name class City3D(NamedModel): point = models.PointField(dim=3) pointg = models.PointField(dim=3, geography...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geo3d/__init__.py
tests/gis_tests/geo3d/__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/geo3d/tests.py
tests/gis_tests/geo3d/tests.py
import os import re from django.contrib.gis.db.models import Extent3D, Q, Union from django.contrib.gis.db.models.functions import ( AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon from django.test import Test...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geogapp/models.py
tests/gis_tests/geogapp/models.py
from django.contrib.gis.db import models class NamedModel(models.Model): name = models.CharField(max_length=30) class Meta: abstract = True def __str__(self): return self.name class City(NamedModel): point = models.PointField(geography=True) class Meta: app_label = "ge...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geogapp/__init__.py
tests/gis_tests/geogapp/__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/geogapp/tests.py
tests/gis_tests/geogapp/tests.py
""" Tests for geography support in PostGIS """ import os from django.contrib.gis.db import models from django.contrib.gis.db.models.functions import Area, Distance from django.contrib.gis.measure import D from django.core.exceptions import ValidationError from django.db import NotSupportedError, connection from djang...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoadmin/models.py
tests/gis_tests/geoadmin/models.py
from django.contrib.gis.db import models from ..admin import admin class City(models.Model): name = models.CharField(max_length=30) point = models.PointField() class Meta: app_label = "geoadmin" def __str__(self): return self.name class CityAdminCustomWidgetKwargs(admin.GISModelAd...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoadmin/__init__.py
tests/gis_tests/geoadmin/__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/geoadmin/tests.py
tests/gis_tests/geoadmin/tests.py
from django.contrib.gis.geos import Point from django.test import SimpleTestCase, override_settings from .models import City, site, site_gis, site_gis_custom @override_settings(ROOT_URLCONF="django.contrib.gis.tests.geoadmin.urls") class GeoAdminTest(SimpleTestCase): admin_site = site # ModelAdmin def test...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geoadmin/urls.py
tests/gis_tests/geoadmin/urls.py
from django.contrib import admin from django.urls import include, path urlpatterns = [ path("admin/", include(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/gis_tests/layermap/models.py
tests/gis_tests/layermap/models.py
from django.contrib.gis.db import models class NamedModel(models.Model): name = models.CharField(max_length=25) class Meta: abstract = True def __str__(self): return self.name class State(NamedModel): pass class County(NamedModel): state = models.ForeignKey(State, models.CASC...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/layermap/__init__.py
tests/gis_tests/layermap/__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/layermap/tests.py
tests/gis_tests/layermap/tests.py
import datetime import unittest from copy import copy from decimal import Decimal from pathlib import Path from django.conf import settings from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils.layermapping import ( InvalidDecimal, InvalidString, LayerMapError, LayerMapping, ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geos_tests/test_io.py
tests/gis_tests/geos_tests/test_io.py
import binascii from django.contrib.gis.geos import ( GEOSGeometry, Point, Polygon, WKBReader, WKBWriter, WKTReader, WKTWriter, ) from django.contrib.gis.geos.libgeos import geos_version_tuple from django.test import SimpleTestCase class GEOSIOTest(SimpleTestCase): def test01_wktreade...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geos_tests/test_geos_mutation.py
tests/gis_tests/geos_tests/test_geos_mutation.py
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.contrib.gis.geos import ( LinearRing, LineString, MultiPoint, Point, Polygon, fromstr, ) from django.test imp...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geos_tests/test_coordseq.py
tests/gis_tests/geos_tests/test_coordseq.py
from django.contrib.gis.geos import LineString from django.test import SimpleTestCase class GEOSCoordSeqTest(SimpleTestCase): def test_getitem(self): coord_seq = LineString([(x, x) for x in range(2)]).coord_seq for i in (0, 1): with self.subTest(i): self.assertEqual(coo...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geos_tests/test_geos.py
tests/gis_tests/geos_tests/test_geos.py
import ctypes import itertools import json import math import pickle import random from binascii import a2b_hex from io import BytesIO from unittest import mock, skipIf from django.contrib.gis import gdal from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LinearRing,...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/geos_tests/__init__.py
tests/gis_tests/geos_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/gis_tests/geos_tests/test_mutable_list.py
tests/gis_tests/geos_tests/test_mutable_list.py
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.contrib.gis.geos.mutable_list import ListMixin from django.test import SimpleTestCase class UserListA(...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/test_geom.py
tests/gis_tests/gdal_tests/test_geom.py
import json import pickle from django.contrib.gis.gdal import ( CoordTransform, GDALException, OGRGeometry, OGRGeomType, SpatialReference, ) from django.contrib.gis.gdal.geometries import CircularString, CurvePolygon from django.contrib.gis.geos import GEOSException from django.template import Cont...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/test_ds.py
tests/gis_tests/gdal_tests/test_ds.py
import os import re from datetime import datetime from pathlib import Path from django.contrib.gis.gdal import DataSource, Envelope, GDALException, OGRGeometry from django.contrib.gis.gdal.field import OFTDateTime, OFTInteger, OFTReal, OFTString from django.contrib.gis.geos import GEOSGeometry from django.test import ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/test_envelope.py
tests/gis_tests/gdal_tests/test_envelope.py
import unittest from django.contrib.gis.gdal import Envelope, GDALException class TestPoint: def __init__(self, x, y): self.x = x self.y = y class EnvelopeTest(unittest.TestCase): def setUp(self): self.e = Envelope(0, 0, 5, 5) def test01_init(self): "Testing Envelope in...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/__init__.py
tests/gis_tests/gdal_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/gis_tests/gdal_tests/test_raster.py
tests/gis_tests/gdal_tests/test_raster.py
import os import shutil import struct import tempfile import zipfile from pathlib import Path from unittest import mock from django.contrib.gis.gdal import GDAL_VERSION, GDALRaster, SpatialReference from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.raster.band import GDALBand from dj...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
true
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/test_srs.py
tests/gis_tests/gdal_tests/test_srs.py
from django.contrib.gis.gdal import ( GDAL_VERSION, AxisOrder, CoordTransform, GDALException, SpatialReference, SRSException, ) from django.contrib.gis.geos import GEOSGeometry from django.test import SimpleTestCase class TestSRS: def __init__(self, wkt, **kwargs): self.wkt = wkt ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/tests.py
tests/gis_tests/gdal_tests/tests.py
import unittest from django.contrib.gis.gdal import GDAL_VERSION, gdal_full_version, gdal_version class GDALTest(unittest.TestCase): def test_gdal_version(self): if GDAL_VERSION: self.assertEqual(gdal_version(), ("%s.%s.%s" % GDAL_VERSION).encode()) else: self.assertIn(b"....
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/gdal_tests/test_driver.py
tests/gis_tests/gdal_tests/test_driver.py
import unittest from unittest import mock from django.contrib.gis.gdal import GDAL_VERSION, Driver, GDALException valid_drivers = ( # vector "ESRI Shapefile", "MapInfo File", "S57", "DGN", "Memory", "CSV", "GML", "KML", # raster "GTiff", "JPEG", "MEM", "PNG", ) ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/rasterapp/models.py
tests/gis_tests/rasterapp/models.py
from django.contrib.gis.db import models class RasterModel(models.Model): rast = models.RasterField( "A Verbose Raster Name", null=True, srid=4326, spatial_index=True, blank=True ) rastprojected = models.RasterField("A Projected Raster Table", srid=3086, null=True) geom = models.PointField(nul...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/rasterapp/__init__.py
tests/gis_tests/rasterapp/__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/rasterapp/test_rasterfield.py
tests/gis_tests/rasterapp/test_rasterfield.py
import json from django.contrib.gis.db.models.fields import BaseSpatialField from django.contrib.gis.db.models.functions import Distance from django.contrib.gis.db.models.lookups import DistanceLookupBase, GISLookup from django.contrib.gis.gdal import GDALRaster from django.contrib.gis.geos import GEOSGeometry from dj...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/rasterapp/migrations/0002_rastermodels.py
tests/gis_tests/rasterapp/migrations/0002_rastermodels.py
from django.contrib.gis.db import models from django.db import migrations from django.db.models import deletion class Migration(migrations.Migration): dependencies = [ ("rasterapp", "0001_setup_extensions"), ] operations = [ migrations.CreateModel( name="RasterModel", ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/rasterapp/migrations/0001_setup_extensions.py
tests/gis_tests/rasterapp/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/rasterapp/migrations/__init__.py
tests/gis_tests/rasterapp/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/distapp/models.py
tests/gis_tests/distapp/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 SouthTexasCity(NamedModel): "City model on projected coord...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/distapp/__init__.py
tests/gis_tests/distapp/__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/distapp/tests.py
tests/gis_tests/distapp/tests.py
from django.contrib.gis.db.models.functions import ( Area, Distance, Length, Perimeter, Transform, Union, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point from django.contrib.gis.measure import D # alias for Distance from django.db import NotSupportedError, connection from ...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/inspectapp/models.py
tests/gis_tests/inspectapp/models.py
from django.contrib.gis.db import models class AllOGRFields(models.Model): f_decimal = models.FloatField() f_float = models.FloatField() f_int = models.IntegerField() f_char = models.CharField(max_length=10) f_date = models.DateField() f_datetime = models.DateTimeField() f_time = models.Ti...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/inspectapp/__init__.py
tests/gis_tests/inspectapp/__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/inspectapp/tests.py
tests/gis_tests/inspectapp/tests.py
import os import re from io import StringIO from django.contrib.gis.gdal import GDAL_VERSION, Driver, GDALException from django.contrib.gis.utils.ogrinspect import ogrinspect from django.core.management import call_command from django.db import connection, connections from django.db.backends.sqlite3.creation import Da...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/relatedapp/models.py
tests/gis_tests/relatedapp/models.py
from django.contrib.gis.db import models class SimpleModel(models.Model): class Meta: abstract = True class Location(SimpleModel): point = models.PointField() def __str__(self): return self.point.wkt class City(SimpleModel): name = models.CharField(max_length=50) state = model...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false
django/django
https://github.com/django/django/blob/3201a895cba335000827b28768a7b7105c81b415/tests/gis_tests/relatedapp/__init__.py
tests/gis_tests/relatedapp/__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/relatedapp/tests.py
tests/gis_tests/relatedapp/tests.py
from django.contrib.gis.db.models import Collect, Count, Extent, F, MakeLine, Q, Union from django.contrib.gis.db.models.functions import Centroid from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import NotSupportedError, connection from django.test import TestCase, skipUnlessDBFeature...
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_regress.py
tests/gis_tests/geoapp/test_regress.py
from datetime import datetime from django.contrib.gis.db.models import Extent from django.contrib.gis.shortcuts import render_to_kmz from django.db.models import Count, Min from django.test import TestCase, skipUnlessDBFeature from ..utils import skipUnlessGISLookup from .models import City, PennsylvaniaCity, State, ...
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_expressions.py
tests/gis_tests/geoapp/test_expressions.py
from django.contrib.gis.db.models import F, GeometryField, Value, functions from django.contrib.gis.geos import Point, Polygon from django.db import connection from django.db.models import Count, Min from django.test import TestCase, skipUnlessDBFeature from .models import City, ManyPointModel, MultiFields class Geo...
python
BSD-3-Clause
3201a895cba335000827b28768a7b7105c81b415
2026-01-04T14:38:15.489092Z
false