Пример #1
0
 def tearDownClass(self):
     """
     Remove test session and tables.
     """
     db.session.rollback()
     db.drop_all()
     db.session.remove()
Пример #2
0
 def tearDown(self):
     """
     Remove test session and tables.
     """
     db.session.rollback()
     db.drop_all()
     db.session.remove()
     self.ctx.pop()
Пример #3
0
 def tearDown(self):
     """
     Remove test session and tables.
     """
     db.session.rollback()
     db.drop_all()
     db.session.remove()
     self.ctx.pop()
Пример #4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from lastuserapp import app, db
from lastuser_core.models import *

#incase data exists from previously run tests
db.drop_all()
#create schema again
db.create_all()

# Add fixtures for test app
# user for CRUD workflow: creating client app
gustav = User(username=u"gustav", fullname=u"Gustav 'world' Dachshund", password='******')

# org for associating with client
# client for CRUD workflow of defining perms *in* client
# spare user for CRUD workflow of assigning permissions
oakley = User(username=u"oakley", fullname=u"Oakley 'huh' Dachshund")
dachsunited = Organization(name=u"dachsunited", title=u"Dachs United")
dachsunited.owners.users.append(gustav)
dachsunited.members.users.append(oakley)
dachshundworld = Client(title=u"Dachshund World", org=dachsunited, confidential=True, website=u"http://gustavsdachshundworld.com")
partyanimal = Permission(name=u"partyanimal", title=u"Party Animal", org=dachsunited)

db.session.add(gustav)
db.session.add(oakley)
db.session.add(dachsunited)
Пример #5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys

reload(sys)
sys.setdefaultencoding('utf-8')

from lastuserapp import app, db
from lastuser_core.models import *

#incase data exists from previously run tests
db.drop_all()
#create schema again
db.create_all()

# Add fixtures for test app
# user for CRUD workflow: creating client app
gustav = User(username=u"gustav",
              fullname=u"Gustav 'world' Dachshund",
              password='******')

# org for associating with client
# client for CRUD workflow of defining perms *in* client
# spare user for CRUD workflow of assigning permissions
oakley = User(username=u"oakley", fullname=u"Oakley 'huh' Dachshund")
dachsunited = Organization(name=u"dachsunited", title=u"Dachs United")
dachsunited.owners.users.append(gustav)
dachsunited.members.users.append(oakley)
dachshundworld = Client(title=u"Dachshund World",
                        org=dachsunited,
                        confidential=True,
Пример #6
0
 def tearDownClass(cls):
     """
     Remove test session and tables.
     """
     db.drop_all()
     db.session.remove()
Пример #7
0
 def tearDownClass(cls):
     """
     Remove test session and tables.
     """
     db.drop_all()
     db.session.remove()
Пример #8
0
 def tearDown(self):
     db.session.rollback()
     db.drop_all()
     db.session.remove()