Changeset 8414
- Timestamp:
- 08/16/08 15:40:47 (4 months ago)
- Files:
-
- django/trunk/django/contrib/gis/feeds.py (added)
- django/trunk/django/contrib/gis/tests/geoapp/feeds.py (added)
- django/trunk/django/contrib/gis/tests/geoapp/test_feeds.py (added)
- django/trunk/django/contrib/gis/tests/geoapp/tests_mysql.py (modified) (1 diff)
- django/trunk/django/contrib/gis/tests/geoapp/tests.py (modified) (2 diffs)
- django/trunk/django/contrib/gis/tests/geoapp/urls.py (added)
- django/trunk/django/contrib/gis/tests/__init__.py (modified) (4 diffs)
- django/trunk/django/contrib/gis/tests/urls.py (added)
- django/trunk/django/contrib/syndication/feeds.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/gis/tests/geoapp/tests_mysql.py
r8219 r8414 174 174 self.assertRaises(ImproperlyConfigured, Country.objects.all().gml, field_name='mpoly') 175 175 176 from test_feeds import GeoFeedTest 176 177 def suite(): 177 178 s = unittest.TestSuite() 178 179 s.addTest(unittest.makeSuite(GeoModelTest)) 180 s.addTest(unittest.makeSuite(GeoFeedTest)) 179 181 return s django/trunk/django/contrib/gis/tests/geoapp/tests.py
r8219 r8414 373 373 374 374 def test14_equals(self): 375 if DISABLE: return376 375 "Testing the 'same_as' and 'equals' lookup types." 376 if DISABLE: return 377 377 pnt = fromstr('POINT (-95.363151 29.763374)', srid=4326) 378 378 c1 = City.objects.get(point=pnt) … … 559 559 self.assertEqual(c.mpoly.union(geom), c.union) 560 560 561 from test_feeds import GeoFeedTest 561 562 def suite(): 562 563 s = unittest.TestSuite() 563 564 s.addTest(unittest.makeSuite(GeoModelTest)) 565 s.addTest(unittest.makeSuite(GeoFeedTest)) 564 566 return s django/trunk/django/contrib/gis/tests/__init__.py
r8308 r8414 1 1 import sys 2 from copy import copy3 2 from unittest import TestSuite, TextTestRunner 4 3 … … 95 94 from django.contrib.gis.tests.utils import mysql 96 95 from django.db import connection 96 from django.db.models import loading 97 97 98 98 # Getting initial values. 99 99 old_debug = settings.DEBUG 100 old_name = copy(settings.DATABASE_NAME) 101 old_installed = copy(settings.INSTALLED_APPS) 102 new_installed = copy(settings.INSTALLED_APPS) 100 old_name = settings.DATABASE_NAME 101 old_installed = settings.INSTALLED_APPS 102 old_root_urlconf = settings.ROOT_URLCONF 103 104 # Based on ALWAYS_INSTALLED_APPS from django test suite -- 105 # this prevents us from creating tables in our test database 106 # from locally installed apps. 107 new_installed = ['django.contrib.contenttypes', 108 'django.contrib.auth', 109 'django.contrib.sites', 110 'django.contrib.flatpages', 111 'django.contrib.gis', 112 'django.contrib.redirects', 113 'django.contrib.sessions', 114 'django.contrib.comments', 115 'django.contrib.admin', 116 ] 117 118 # Setting the URLs. 119 settings.ROOT_URLCONF = 'django.contrib.gis.tests.urls' 103 120 104 121 # Want DEBUG to be set to False. 105 122 settings.DEBUG = False 106 123 107 from django.db.models import loading108 109 124 # Creating the test suite, adding the test models to INSTALLED_APPS, and 110 # adding the model test suites to our suite package.125 # adding the model test suites to our suite package. 111 126 test_suite, test_models = geo_suite() 112 127 for test_model in test_models: … … 118 133 new_installed.append(module_name) 119 134 120 # Getting the test suite 121 tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, globals(), locals(), [test_module_name]), test_module_name) 135 # Getting the model test suite 136 tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, globals(), locals(), [test_module_name]), 137 test_module_name) 122 138 test_suite.addTest(tsuite.suite()) 123 139 … … 139 155 settings.DEBUG = old_debug 140 156 settings.INSTALLED_APPS = old_installed 141 157 settings.ROOT_URLCONF = old_root_urlconf 158 142 159 # Returning the total failures and errors 143 160 return len(result.failures) + len(result.errors) django/trunk/django/contrib/syndication/feeds.py
r8310 r8414 60 60 return attr 61 61 62 def feed_extra_kwargs(self, obj): 63 """ 64 Returns an extra keyword arguments dictionary that is used when 65 initializing the feed generator. 66 """ 67 return {} 68 69 def item_extra_kwargs(self, item): 70 """ 71 Returns an extra keyword arguments dictionary that is used with 72 the `add_item` call of the feed generator. 73 """ 74 return {} 75 62 76 def get_object(self, bits): 63 77 return None … … 101 115 feed_guid = self.__get_dynamic_attr('feed_guid', obj), 102 116 ttl = self.__get_dynamic_attr('ttl', obj), 117 **self.feed_extra_kwargs(obj) 103 118 ) 104 119 … … 159 174 categories = self.__get_dynamic_attr('item_categories', item), 160 175 item_copyright = self.__get_dynamic_attr('item_copyright', item), 176 **self.item_extra_kwargs(item) 161 177 ) 162 178 return feed
