Commits

Andriy Kornatskyy  committed f045450

Added session commit and cursor use mock repository in order to assert session state.

  • Participants
  • Parent commits 6a3f194

Comments (0)

Files changed (3)

File demos/template/setup.py

 README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
 install_requires = [
-    'wheezy.core>=0.1.80',
+    'wheezy.core>=0.1.82',
     'wheezy.caching>=0.1.54',
     'wheezy.html>=0.1.109',
     'wheezy.http>=0.1.236',

File demos/template/src/membership/repository/mock.py

         'biz': u('P@ssw0rd')
     }
     roles = {
-        'demo': tuple(['user']),
-        'biz': tuple(['business'])
+        'demo': ['user'],
+        'biz': ['business']
     }
 
     def __init__(self, session):
-        pass
+        # ensure session is entered
+        session.cursor()
 
     def authenticate(self, credential):
         return credential.password == self.credentials.get(

File demos/template/src/membership/web/views.py

         f = self.factory('rw')
         try:
             f.__enter__()
-            return f.membership.create_account(registration)
+            succeed = f.membership.create_account(registration)
+            f.session.commit()
+            return succeed
         finally:
             f.__exit__(None, None, None)