diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2012-12-18 09:02:07 +0000 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2012-12-18 09:02:07 +0000 |
| commit | b62e82365ad56ca930f7abb1d1dbdf9ce5a7c7c3 (patch) | |
| tree | 76bce44f4c7ee6172dcf116be6e4a26e380ef20a /tests/regressiontests/utils | |
| parent | 6a632e04578776e877adc5e2dc53f008c890a0d4 (diff) | |
| parent | c64b57d16688025b2d48668d5c4cb9eda7484612 (diff) | |
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
django/db/models/loading.py
django/db/models/options.py
Diffstat (limited to 'tests/regressiontests/utils')
| -rw-r--r-- | tests/regressiontests/utils/archive.py | 3 | ||||
| -rw-r--r-- | tests/regressiontests/utils/feedgenerator.py | 8 | ||||
| -rw-r--r-- | tests/regressiontests/utils/html.py | 3 | ||||
| -rw-r--r-- | tests/regressiontests/utils/module_loading.py | 3 |
4 files changed, 13 insertions, 4 deletions
diff --git a/tests/regressiontests/utils/archive.py b/tests/regressiontests/utils/archive.py index 5575f340f6..8861b4a577 100644 --- a/tests/regressiontests/utils/archive.py +++ b/tests/regressiontests/utils/archive.py @@ -4,9 +4,10 @@ import tempfile from django.utils import unittest from django.utils.archive import Archive, extract +from django.utils._os import upath -TEST_DIR = os.path.join(os.path.dirname(__file__), 'archives') +TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives') class ArchiveTester(object): diff --git a/tests/regressiontests/utils/feedgenerator.py b/tests/regressiontests/utils/feedgenerator.py index b646a5997d..bcd53bb2a0 100644 --- a/tests/regressiontests/utils/feedgenerator.py +++ b/tests/regressiontests/utils/feedgenerator.py @@ -104,10 +104,14 @@ class FeedgeneratorTest(unittest.TestCase): feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr') self.assertEqual(feed.feed['feed_url'], None) feed_content = feed.writeString('utf-8') - self.assertNotIn('<atom:link href=', feed_content) + self.assertNotIn('<atom:link', feed_content) + self.assertNotIn('href="/feed/"', feed_content) + self.assertNotIn('rel="self"', feed_content) def test_feed_with_feed_url_gets_rendered_with_atom_link(self): feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/') self.assertEqual(feed.feed['feed_url'], '/feed/') feed_content = feed.writeString('utf-8') - self.assertIn('<atom:link href="/feed/" rel="self"></atom:link>', feed_content) + self.assertIn('<atom:link', feed_content) + self.assertIn('href="/feed/"', feed_content) + self.assertIn('rel="self"', feed_content) diff --git a/tests/regressiontests/utils/html.py b/tests/regressiontests/utils/html.py index 6a93dff85e..a0226c4765 100644 --- a/tests/regressiontests/utils/html.py +++ b/tests/regressiontests/utils/html.py @@ -65,6 +65,9 @@ class TestUtilsHtml(unittest.TestCase): ('<f', '<f'), ('</fe', '</fe'), ('<x>b<y>', 'b'), + ('a<p onclick="alert(\'<test>\')">b</p>c', 'abc'), + ('a<p a >b</p>c', 'abc'), + ('d<a:b c:d>e</p>f', 'def'), ) for value, output in items: self.check_output(f, value, output) diff --git a/tests/regressiontests/utils/module_loading.py b/tests/regressiontests/utils/module_loading.py index dffb51966c..3fc92b0862 100644 --- a/tests/regressiontests/utils/module_loading.py +++ b/tests/regressiontests/utils/module_loading.py @@ -6,6 +6,7 @@ from zipimport import zipimporter from django.utils import unittest from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule +from django.utils._os import upath class DefaultLoader(unittest.TestCase): @@ -50,7 +51,7 @@ class DefaultLoader(unittest.TestCase): class EggLoader(unittest.TestCase): def setUp(self): self.old_path = sys.path[:] - self.egg_dir = '%s/eggs' % os.path.dirname(__file__) + self.egg_dir = '%s/eggs' % os.path.dirname(upath(__file__)) def tearDown(self): sys.path = self.old_path |
