summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki/src/models
diff options
context:
space:
mode:
authorkenmanheimer <ken.manheimer@gmail.com>2011-11-10 12:47:02 -0800
committerkenmanheimer <ken.manheimer@gmail.com>2011-11-10 12:47:02 -0800
commitfa9113792da7cccf34ea05a3821fc8d2335db33a (patch)
tree0e5c3a0a76a94870c5a94a6d04f19078ebf965ed /docs/tutorials/wiki/src/models
parent090e31fadd53389755706dd9c4d7a96ac1f047a5 (diff)
downloadpyramid-fa9113792da7cccf34ea05a3821fc8d2335db33a.tar.gz
pyramid-fa9113792da7cccf34ea05a3821fc8d2335db33a.tar.bz2
pyramid-fa9113792da7cccf34ea05a3821fc8d2335db33a.zip
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'.
Diffstat (limited to 'docs/tutorials/wiki/src/models')
-rw-r--r--docs/tutorials/wiki/src/models/tutorial/tests.py10
1 files changed, 5 insertions, 5 deletions
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')