~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to tests/test_webapps/filestotest/functional_sample_controller_sqlatesting.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from projectname.tests import *
2
2
from sqlalchemy.exceptions import IntegrityError
3
 
from projectname.model.meta import Session, metadata
 
3
from projectname.model.meta import Session, Base
4
4
from projectname.model import Foo
5
5
 
6
6
class TestSQLAlchemyController(TestController):
7
7
    def setUp(self):
8
 
        metadata.create_all(bind=Session.bind)
 
8
        Base.metadata.create_all(bind=Session.bind)
9
9
        f = Foo(id = 1, bar = u"Wabbit")
10
10
        Session.add(f)
11
11
        Session.commit()
12
12
        assert f.bar == u"Wabbit"
13
13
    
14
14
    def tearDown(self):
15
 
        metadata.drop_all(bind=Session.bind)
 
15
        Base.metadata.drop_all(bind=Session.bind)
16
16
 
17
17
    def test_sqlalchemy(self):
18
18
        response = self.app.get(url(controller='sample', action='testsqlalchemy'))