From fa9113792da7cccf34ea05a3821fc8d2335db33a Mon Sep 17 00:00:00 2001 From: kenmanheimer Date: Thu, 10 Nov 2011 12:47:02 -0800 Subject: Convert absolute 'tutorial' package references that are from within the package to relative ones, to reduce brittleness, eg when the user names the package something other than 'tutorial'. - make imports relative - use plain relative URLs for resources (like stylesheets and images) in page templates. This is the last batch of this kind of change that I know about. I've exercised the changes (via the browser and the test target) in a package with an alternate name, 'zodbtutorial', as well as in a package with the default name, 'tutorial'. --- docs/tutorials/wiki/src/models/tutorial/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/tutorials/wiki/src/models') diff --git a/docs/tutorials/wiki/src/models/tutorial/tests.py b/docs/tutorials/wiki/src/models/tutorial/tests.py index 51c97a95d..9fd13a18d 100644 --- a/docs/tutorials/wiki/src/models/tutorial/tests.py +++ b/docs/tutorials/wiki/src/models/tutorial/tests.py @@ -5,7 +5,7 @@ from pyramid import testing class PageModelTests(unittest.TestCase): def _getTargetClass(self): - from tutorial.models import Page + from .models import Page return Page def _makeOne(self, data=u'some data'): @@ -14,11 +14,11 @@ class PageModelTests(unittest.TestCase): def test_constructor(self): instance = self._makeOne() self.assertEqual(instance.data, u'some data') - + class WikiModelTests(unittest.TestCase): def _getTargetClass(self): - from tutorial.models import Wiki + from .models import Wiki return Wiki def _makeOne(self): @@ -32,7 +32,7 @@ class WikiModelTests(unittest.TestCase): class AppmakerTests(unittest.TestCase): def _callFUT(self, zodb_root): - from tutorial.models import appmaker + from .models import appmaker return appmaker(zodb_root) def test_no_app_root(self): @@ -55,7 +55,7 @@ class ViewTests(unittest.TestCase): testing.tearDown() def test_my_view(self): - from tutorial.views import my_view + from .views import my_view request = testing.DummyRequest() info = my_view(request) self.assertEqual(info['project'], 'tutorial') -- cgit v1.2.3