Exemplo n.º 1
0
 def setUp(self):
     init_for('testing')
     app.config['TESTING'] = True
     db.app = app
     db.create_all()
     self.db = db
     make_fixtures()
Exemplo n.º 2
0
 def setUpClass(cls):
     """
     Initialize a test DB and call to make fixtures.
     """
     cls.app = app
     db.create_all()
     cls.fixtures = Fixtures()
     cls.fixtures.make_fixtures()
     cls.fixtures.test_client = app.test_client()
Exemplo n.º 3
0
 def setUpClass(cls):
     """
     Initialize a test DB and call to make fixtures.
     """
     cls.app = app
     db.create_all()
     cls.fixtures = Fixtures()
     cls.fixtures.make_fixtures()
     cls.fixtures.test_client = app.test_client()
Exemplo n.º 4
0
    def setUp(self):
        """
        Initialize a test DB and call to make fixtures.

        """
        self.ctx = app.test_request_context()
        self.ctx.push()
        self.app = app
        db.create_all()
        self.client = app.test_client()
        self.fixtures = Fixtures()
        self.fixtures.make_fixtures()
Exemplo n.º 5
0
    def setUp(self):
        """
        Initialize a test DB and call to make fixtures.

        """
        self.ctx = app.test_request_context()
        self.ctx.push()
        self.app = app
        db.create_all()
        self.client = app.test_client()
        self.fixtures = Fixtures()
        self.fixtures.make_fixtures()
Exemplo n.º 6
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)
Exemplo n.º 7
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,