1. Graham Higgins
  2. Shabti

Commits

Graham Higgins  committed 6dc28ae

Adjustments to tests. Bump setup.py to require Pylons==1.0

  • Participants
  • Parent commits 81c6363
  • Branches default

Comments (0)

Files changed (4)

File setup.py

View file
     ],
     zip_safe=False,
     packages=find_packages(),
-    install_requires=["Pylons>0.9.7", 
+    install_requires=["Pylons==1.0", 
                       "Elixir>=0.6",
                       "SQLAlchemy>=0.5.8"],
     extras_require={"migrate" : ["sqlalchemy-migrate>=0.5.3"],

File shabti/templates/default/+package+/lib/base.py_tmpl

View file
 {{if template_engine in ('genshi', 'jinja2', 'mako')}}
 from pylons.templating import render_{{template_engine}} as render
 {{endif}}
+{{if sqlalchemy}}
+
 from {{package}} import model
+{{endif}}
 
 class BaseController(WSGIController):
     
         # available in environ['pylons.routes_dict']
         
         # Insert any code to be run per request here.
-        
+        {{if sqlalchemy}}
         try:
             return WSGIController.__call__(self, environ, start_response)
         finally:
-            model.Session.remove()
+            Session.remove(){{else}}        return WSGIController.__call__(self, environ, start_response){{endif}}
     
 
 

File shabti/templates/pyblosxom/+package+/tests/__init__.py_tmpl

View file
 
 from {{package}}.config.environment import load_environment
 
-from elixir import *
-from {{package}}.model import *
-from {{package}}.model import meta
-from {{package}} import model as model
-from sqlalchemy import engine_from_config
-
 __all__ = ['environ', 'url', 'TestController', 'TestModel']
 
 
 config = load_environment(conf.global_conf, conf.local_conf)
 environ = {}
 
-engine = engine_from_config(config, 'sqlalchemy.')
-model.init_model(engine)
-metadata = elixir.metadata
-Session = elixir.session = meta.Session
-
-class Individual(Entity):
-    """Table 'Individual'.
-
-    >>> me = Individual('Groucho')
-
-    # 'name' field is converted to lowercase
-    >>> me.name
-    'groucho'
-    """
-    name = Field(String(20), unique=True)
-    favorite_color = Field(String(20))
-
-    def __init__(self, name, favorite_color=None):
-        self.name = str(name).lower()
-        self.favorite_color = favorite_color
-
-setup_all()
-
 filecontent = '''\
 Initial post
 #author Graham Higgins

File shabti/templates/pyblosxom/+package+/tests/functional/test_blog_page.py_tmpl

View file
 from {{package}}.tests import *
-from {{package}}.tests import TestController, Session, metadata
+from {{package}}.tests import TestController
 
 class TestBlogPage(TestController):