mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[1.2.X] A few test optimizations; using native unittest where no Django-specific TestCase features are required.
Backport of r13935 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13943 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import os
|
||||
import sys
|
||||
from unittest import TestCase
|
||||
import unittest
|
||||
from zipimport import zipimporter
|
||||
|
||||
from django.utils.importlib import import_module
|
||||
from django.utils.module_loading import module_has_submodule
|
||||
|
||||
class DefaultLoader(TestCase):
|
||||
class DefaultLoader(unittest.TestCase):
|
||||
def test_loader(self):
|
||||
"Normal module existence can be tested"
|
||||
test_module = import_module('regressiontests.utils.test_module')
|
||||
@@ -24,7 +24,7 @@ class DefaultLoader(TestCase):
|
||||
self.assertFalse(module_has_submodule(test_module, 'no_such_module'))
|
||||
self.assertRaises(ImportError, import_module, 'regressiontests.utils.test_module.no_such_module')
|
||||
|
||||
class EggLoader(TestCase):
|
||||
class EggLoader(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.old_path = sys.path
|
||||
self.egg_dir = '%s/eggs' % os.path.dirname(__file__)
|
||||
|
||||
Reference in New Issue
Block a user