Remove a great many of the remaining relative imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
544a8372fd
commit
66210cbc70
|
@ -1,16 +1,20 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django import http
|
from django import http
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from utils import next_redirect, confirmation_view
|
from django.contrib import comments
|
||||||
|
from django.contrib.comments import signals
|
||||||
|
from django.contrib.comments.views.utils import next_redirect, confirmation_view
|
||||||
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
from django.views.decorators.http import require_POST
|
|
||||||
from django.contrib import comments
|
|
||||||
from django.contrib.comments import signals
|
|
||||||
from django.views.decorators.csrf import csrf_protect
|
from django.views.decorators.csrf import csrf_protect
|
||||||
|
from django.views.decorators.http import require_POST
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CommentPostBadRequest(http.HttpResponseBadRequest):
|
class CommentPostBadRequest(http.HttpResponseBadRequest):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.shortcuts import get_object_or_404, render_to_response
|
|
||||||
from django.contrib.auth.decorators import login_required, permission_required
|
|
||||||
from utils import next_redirect, confirmation_view
|
|
||||||
from django.contrib import comments
|
from django.contrib import comments
|
||||||
|
from django.contrib.auth.decorators import login_required, permission_required
|
||||||
from django.contrib.comments import signals
|
from django.contrib.comments import signals
|
||||||
|
from django.contrib.comments.views.utils import next_redirect, confirmation_view
|
||||||
|
from django.shortcuts import get_object_or_404, render_to_response
|
||||||
from django.views.decorators.csrf import csrf_protect
|
from django.views.decorators.csrf import csrf_protect
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@csrf_protect
|
@csrf_protect
|
||||||
@login_required
|
@login_required
|
||||||
def flag(request, comment_id, next=None):
|
def flag(request, comment_id, next=None):
|
||||||
|
|
|
@ -2,11 +2,14 @@
|
||||||
This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
|
This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
from django.contrib.formtools.tests import TestFormPreview, TestWizardClass
|
from django.contrib.formtools.tests import TestFormPreview, TestWizardClass
|
||||||
|
|
||||||
from forms import (ContactWizard, Page1, Page2, Page3, TestForm,
|
from django.contrib.formtools.tests.forms import (ContactWizard, Page1, Page2,
|
||||||
WizardPageOneForm, WizardPageTwoForm, WizardPageThreeForm)
|
Page3, TestForm, WizardPageOneForm, WizardPageTwoForm, WizardPageThreeForm)
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^preview/', TestFormPreview(TestForm)),
|
url(r'^preview/', TestFormPreview(TestForm)),
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.contrib.gis.geos import GEOSGeometry, LineString
|
from django.contrib.gis.geos import GEOSGeometry, LineString
|
||||||
|
@ -5,9 +7,10 @@ from django.contrib.gis.measure import D # alias for Distance
|
||||||
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatialite
|
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatialite
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from models import (AustraliaCity, Interstate, SouthTexasInterstate,
|
from .models import (AustraliaCity, Interstate, SouthTexasInterstate,
|
||||||
SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode)
|
SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode)
|
||||||
|
|
||||||
|
|
||||||
class DistanceTest(TestCase):
|
class DistanceTest(TestCase):
|
||||||
|
|
||||||
# A point we are testing distances with -- using a WGS84
|
# A point we are testing distances with -- using a WGS84
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django.utils.unittest import TestCase
|
from django.utils.unittest import TestCase
|
||||||
from django.contrib.gis.db.models import Union, Extent3D
|
from django.contrib.gis.db.models import Union, Extent3D
|
||||||
from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
|
from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
|
||||||
from django.contrib.gis.utils import LayerMapping, LayerMapError
|
from django.contrib.gis.utils import LayerMapping, LayerMapError
|
||||||
|
|
||||||
from models import (City3D, Interstate2D, Interstate3D,
|
from .models import (City3D, Interstate2D, Interstate3D, InterstateProj2D,
|
||||||
InterstateProj2D, InterstateProj3D,
|
InterstateProj3D, Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D)
|
||||||
Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D)
|
|
||||||
|
|
||||||
data_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
|
data_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
|
||||||
city_file = os.path.join(data_path, 'cities', 'cities.shp')
|
city_file = os.path.join(data_path, 'cities', 'cities.shp')
|
||||||
|
@ -106,7 +108,7 @@ class Geo3DTest(TestCase):
|
||||||
|
|
||||||
def test01a_3d_layermapping(self):
|
def test01a_3d_layermapping(self):
|
||||||
"Testing LayerMapping on 3D models."
|
"Testing LayerMapping on 3D models."
|
||||||
from models import Point2D, Point3D
|
from .models import Point2D, Point3D
|
||||||
|
|
||||||
point_mapping = {'point' : 'POINT'}
|
point_mapping = {'point' : 'POINT'}
|
||||||
mpoint_mapping = {'mpoint' : 'MULTIPOINT'}
|
mpoint_mapping = {'mpoint' : 'MULTIPOINT'}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.contrib.gis import admin
|
from django.contrib.gis import admin
|
||||||
from models import City
|
|
||||||
|
from .models import City
|
||||||
|
|
||||||
|
|
||||||
class GeoAdminTest(TestCase):
|
class GeoAdminTest(TestCase):
|
||||||
urls = 'django.contrib.gis.tests.geoadmin.urls'
|
urls = 'django.contrib.gis.tests.geoadmin.urls'
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.contrib.gis import feeds
|
from django.contrib.gis import feeds
|
||||||
from models import City
|
|
||||||
|
from .models import City
|
||||||
|
|
||||||
|
|
||||||
class TestGeoRSS1(feeds.Feed):
|
class TestGeoRSS1(feeds.Feed):
|
||||||
link = '/city/'
|
link = '/city/'
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap
|
from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap
|
||||||
from models import City, Country
|
|
||||||
from feeds import feed_dict
|
from .feeds import feed_dict
|
||||||
|
from .models import City, Country
|
||||||
|
|
||||||
|
|
||||||
sitemaps = {'kml' : KMLSitemap([City, Country]),
|
sitemaps = {'kml' : KMLSitemap([City, Country]),
|
||||||
'kmz' : KMZSitemap([City, Country]),
|
'kmz' : KMZSitemap([City, Country]),
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.sites.models import Site
|
from django.contrib.sites.models import Site
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from models import City
|
from .models import City
|
||||||
|
|
||||||
|
|
||||||
class GeoFeedTest(TestCase):
|
class GeoFeedTest(TestCase):
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
|
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
|
||||||
from django.contrib.gis.shortcuts import render_to_kmz
|
from django.contrib.gis.shortcuts import render_to_kmz
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from models import City, PennsylvaniaCity, State
|
|
||||||
|
from .models import City, PennsylvaniaCity, State
|
||||||
|
|
||||||
|
|
||||||
class GeoRegressionTests(TestCase):
|
class GeoRegressionTests(TestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.sites.models import Site
|
from django.contrib.sites.models import Site
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from models import City, Country
|
from .models import City, Country
|
||||||
|
|
||||||
|
|
||||||
class GeoSitemapTest(TestCase):
|
class GeoSitemapTest(TestCase):
|
||||||
|
@ -78,7 +81,7 @@ class GeoSitemapTest(TestCase):
|
||||||
|
|
||||||
def test_geositemap_georss(self):
|
def test_geositemap_georss(self):
|
||||||
"Tests GeoRSS geographic sitemaps."
|
"Tests GeoRSS geographic sitemaps."
|
||||||
from feeds import feed_dict
|
from .feeds import feed_dict
|
||||||
|
|
||||||
doc = minidom.parseString(self.client.get('/sitemaps/georss.xml').content)
|
doc = minidom.parseString(self.client.get('/sitemaps/georss.xml').content)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.db.utils import DatabaseError
|
from django.db.utils import DatabaseError
|
||||||
from django.contrib.gis import gdal
|
from django.contrib.gis import gdal
|
||||||
|
@ -9,10 +12,10 @@ from django.contrib.gis.tests.utils import (
|
||||||
mysql, oracle, postgis, spatialite)
|
mysql, oracle, postgis, spatialite)
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from models import Country, City, PennsylvaniaCity, State, Track
|
from .models import Country, City, PennsylvaniaCity, State, Track
|
||||||
|
|
||||||
if not spatialite:
|
if not spatialite:
|
||||||
from models import Feature, MinusOneSRID
|
from .models import Feature, MinusOneSRID
|
||||||
|
|
||||||
class GeoModelTest(TestCase):
|
class GeoModelTest(TestCase):
|
||||||
|
|
||||||
|
@ -733,6 +736,6 @@ class GeoModelTest(TestCase):
|
||||||
self.assertEqual(ref_hash, h1.geohash)
|
self.assertEqual(ref_hash, h1.geohash)
|
||||||
self.assertEqual(ref_hash[:5], h2.geohash)
|
self.assertEqual(ref_hash[:5], h2.geohash)
|
||||||
|
|
||||||
from test_feeds import GeoFeedTest
|
from .test_feeds import GeoFeedTest
|
||||||
from test_regress import GeoRegressionTests
|
from .test_regress import GeoRegressionTests
|
||||||
from test_sitemaps import GeoSitemapTest
|
from .test_sitemaps import GeoSitemapTest
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.conf.urls import patterns
|
from django.conf.urls import patterns
|
||||||
from feeds import feed_dict
|
|
||||||
|
from .feeds import feed_dict
|
||||||
|
from .sitemaps import sitemaps
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
(r'^feeds/(?P<url>.*)/$', 'django.contrib.gis.views.feed', {'feed_dict': feed_dict}),
|
(r'^feeds/(?P<url>.*)/$', 'django.contrib.gis.views.feed', {'feed_dict': feed_dict}),
|
||||||
)
|
)
|
||||||
|
|
||||||
from sitemaps import sitemaps
|
|
||||||
urlpatterns += patterns('django.contrib.gis.sitemaps.views',
|
urlpatterns += patterns('django.contrib.gis.sitemaps.views',
|
||||||
(r'^sitemap.xml$', 'index', {'sitemaps' : sitemaps}),
|
(r'^sitemap.xml$', 'index', {'sitemaps' : sitemaps}),
|
||||||
(r'^sitemaps/(?P<section>\w+)\.xml$', 'sitemap', {'sitemaps' : sitemaps}),
|
(r'^sitemaps/(?P<section>\w+)\.xml$', 'sitemap', {'sitemaps' : sitemaps}),
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
"""
|
"""
|
||||||
Tests for geography support in PostGIS 1.5+
|
Tests for geography support in PostGIS 1.5+
|
||||||
"""
|
"""
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.contrib.gis import gdal
|
from django.contrib.gis import gdal
|
||||||
from django.contrib.gis.measure import D
|
from django.contrib.gis.measure import D
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from models import City, County, Zipcode
|
|
||||||
|
from .models import City, County, Zipcode
|
||||||
|
|
||||||
|
|
||||||
class GeographyTest(TestCase):
|
class GeographyTest(TestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.db import connections
|
from django.db import connections
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.contrib.gis.gdal import Driver
|
from django.contrib.gis.gdal import Driver
|
||||||
from django.contrib.gis.geometry.test_data import TEST_DATA
|
from django.contrib.gis.geometry.test_data import TEST_DATA
|
||||||
from django.contrib.gis.utils.ogrinspect import ogrinspect
|
from django.contrib.gis.utils.ogrinspect import ogrinspect
|
||||||
from models import AllOGRFields
|
|
||||||
|
from .models import AllOGRFields
|
||||||
|
|
||||||
|
|
||||||
class OGRInspectTest(TestCase):
|
class OGRInspectTest(TestCase):
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
@ -8,10 +10,11 @@ from django.contrib.gis.gdal import DataSource
|
||||||
from django.contrib.gis.tests.utils import mysql
|
from django.contrib.gis.tests.utils import mysql
|
||||||
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey
|
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey
|
||||||
|
|
||||||
from models import (
|
from .models import (
|
||||||
City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State,
|
City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State,
|
||||||
city_mapping, co_mapping, cofeat_mapping, inter_mapping)
|
city_mapping, co_mapping, cofeat_mapping, inter_mapping)
|
||||||
|
|
||||||
|
|
||||||
shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data'))
|
shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data'))
|
||||||
city_shp = os.path.join(shp_path, 'cities', 'cities.shp')
|
city_shp = os.path.join(shp_path, 'cities', 'cities.shp')
|
||||||
co_shp = os.path.join(shp_path, 'counties', 'counties.shp')
|
co_shp = os.path.join(shp_path, 'counties', 'counties.shp')
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
|
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
|
||||||
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
|
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
|
||||||
from django.contrib.gis.geometry.backend import Geometry
|
from django.contrib.gis.geometry.backend import Geometry
|
||||||
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spatialite
|
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spatialite
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
from .models import City, Location, DirectoryEntry, Parcel, Book, Author, Article
|
||||||
|
|
||||||
from models import City, Location, DirectoryEntry, Parcel, Book, Author, Article
|
|
||||||
|
|
||||||
class RelatedGeoModelTest(TestCase):
|
class RelatedGeoModelTest(TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue