@@ -269,58 +269,13 @@ def test_redirect_with_lazy_reverse(self):
269269 response = self .client .get ('/ipr/update/' )
270270 self .assertRedirects (response , "/ipr/" , status_code = 301 )
271271
272- loaded_fixtures = []
273-
274272class TestCase (django .test .TestCase ):
275273 """
276- Does basically the same as django.test.TestCase, but if the test database has
277- support for transactions, it loads perma_fixtures before the transaction which
278- surrounds every test. This causes the perma_fixtures to stay in the database
279- after the transaction which surrounds each test is rolled back, which lets us
280- load each preload_fixture only once. However, it requires that all the
281- perma_fixtures are consistent with each other and with all regular fixtures
282- across all applications. You could view the perma_fixtures as on_the_fly
283- initial_data for tests.
284-
285- Regular fixtures are re-loaded for each TestCase, as usual.
286-
287- We don't flush the database, as that triggers a re-load of initial_data.
274+ Does basically the same as django.test.TestCase, but adds asserts for html5 validation.
288275 """
289276
290277 parser = html5lib .HTMLParser (strict = True )
291278
292- def _fixture_setup (self ):
293- global loaded_fixtures
294-
295- if not connections_support_transactions ():
296- if hasattr (self , 'perma_fixtures' ):
297- if not hasattr (self , 'fixtures' ):
298- self .fixtures = self .perma_fixtures
299- else :
300- self .fixtures += self .perma_fixtures
301- return super (TestCase , self )._fixture_setup ()
302-
303- # If the test case has a multi_db=True flag, setup all databases.
304- # Otherwise, just use default.
305- if getattr (self , 'multi_db' , False ):
306- databases = connections
307- else :
308- databases = [DEFAULT_DB_ALIAS ]
309-
310- for db in databases :
311- if hasattr (self , 'perma_fixtures' ):
312- fixtures = [ fixture for fixture in self .perma_fixtures if not fixture in loaded_fixtures ]
313- if fixtures :
314- call_command ('loaddata' , * fixtures , ** {
315- 'verbosity' : 0 ,
316- 'commit' : False ,
317- 'database' : db
318- })
319- loaded_fixtures += fixtures
320-
321- super (TestCase , self )._fixture_setup ()
322-
323-
324279 def assertValidHTML (self , data ):
325280 try :
326281 self .parser .parse (data )
0 commit comments