def setUp(self): model.setModel('mem') try: model.user.add({'email': 'a', 'password': '******'}) except Exception as e: print "SEtup warn", e
#! /usr/bin/env python """Main PKS timesheet handler. It simply registers the handlers. It provides also a development interface with a test backend.""" import os import sys import webapp2 import holiday import user import model model.setModel(os.environ.get('PKSMEMORYMODEL', 'datastore')) # # support PATCH methods, as long as # https://code.google.com/archive/p/webapp-improved/issues/69 is not merged # to mainline. allowed_methods = webapp2.WSGIApplication.allowed_methods new_allowed_methods = allowed_methods.union(('PATCH', )) webapp2.WSGIApplication.allowed_methods = new_allowed_methods app = webapp2.WSGIApplication([ ('/user', user.UserCollection), ('/user/auth', user.User), ('/user/([^/]+)/(meta|active)?$', user.User), ('/user/([^/]+)/report', user.Report), ('/user/([^/]+)/report/(.+)', user.Report), ('/user/([^/]+)/day', user.Day), ('/holiday$', holiday.CalendarList), ('/holiday/([^/]+)', holiday.CalendarDay), ],
def setUp(self): model.setModel('mem')