コード例 #1
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.modules.common.stores.currencies import CurrencyStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.currencyStore = CurrencyStore(self.mgr, 'default')
コード例 #2
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.modules.admin.stores.permissions import PermissionsStore
        from saas.app.core.stores.client import ClientStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.permissionStore = PermissionsStore(self.mgr, 'default')
        self.clientStore = ClientStore(self.mgr, 'default')
コード例 #3
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientStore = ClientStore(self.mgr, 'default')

        self.default_client = self.clientStore.getDefaultClient()
コード例 #4
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.project.stores.projects import ProjectStore

        mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientStore = ClientStore(mgr, 'default')
        self.projects = ProjectStore(mgr, 'default')

        self.defaultClient = self.clientStore.getDefaultClient()
コード例 #5
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.clients.stores.organizations import OrganizationsStore

        self.mgr = ConnectionManager({
            'app.config': '../../etc'
        })
        self.clientStore = ClientStore(self.mgr, 'default')
        self.orgStore = OrganizationsStore(self.mgr, 'default')
        self.client = self.clientStore.getDefaultClient()
コード例 #6
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.modules.inventory.stores.facility import FacilityStore
        from saas.app.modules.inventory.stores.locations import LocationStore
        from saas.app.core.stores.client import ClientStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.facilityStore = FacilityStore(self.mgr, 'default')
        self.locationStore = LocationStore(self.mgr, 'default')
        self.clientStore = ClientStore(self.mgr, 'default')
        self.client = self.clientStore.getDefaultClient()
コード例 #7
0
def includeme(config):
    log.debug('including: saas.app.core.services')
    settings = config.get_settings()

    connections = ConnectionManager(settings)
    __services['connection.manager'] = connections

    schema_path = settings['schema.path']
    validator = SchemaValidator(schema_path)
    __services['validator.json'] = validator

    __services['modules'] = {}

    config.add_request_method(get_service, name='services')
コード例 #8
0
    def setUp(self):
        self.settings = get_appsettings('testing.ini', name='main')

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientStore = ClientStore(self.mgr, 'default')
        self.defaultClient = self.clientStore.getDefaultClient()

        default_client_id = self.defaultClient[0]

        usersStore = UsersStore(self.mgr, 'default')
        users = usersStore.getAllClientUsers(default_client_id)
        default_user = users[0]
        default_user_email = default_user[2]

        log.warning('email: %s', default_user_email)
        log.warning('client: %s', self.defaultClient[2])

        # self.session = webdriver.Firefox()
        self.session = webdriver.Chrome()
        self.session.get('http://saas.com')

        # set up cookie
        JWT_KEY = self.settings['jwt.secret']
        COOKIE_MAX_AGE = self.settings['cookie.max_age']

        now = time.time()
        created = renewed = accessed = now

        cookie_value = jwt.encode(
            {
                'email': default_user_email,
                'client': default_client_id,
                'iat': created,
                'updated_at': renewed
            },
            key=JWT_KEY,
            algorithm='HS256')

        self.session.add_cookie({
            'name': 'session',
            'value': cookie_value.decode('utf-8'),
            'max_age': COOKIE_MAX_AGE,
            'path': '/',
            'secure': False,
            'samesite': 'Lax'
        })

        # reload page
        self.session.get('http://saas.com')
コード例 #9
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.hr.stores.members import MembersStore
        from saas.app.modules.hr.stores.time_entries import TimeEntriesStore

        self.mgr = ConnectionManager({
            'app.config': '../../etc'
        })
        self.clientStore = ClientStore(self.mgr, 'default')
        self.defaultClient = self.clientStore.getDefaultClient()
        self.mStore = MembersStore(self.mgr, 'default')
        self.store = TimeEntriesStore(self.mgr, 'default')
コード例 #10
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.accounting.stores.accounts import AccountsStore
        from saas.app.modules.accounting.stores.groups import GroupStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientStore = ClientStore(self.mgr, 'default')
        self.groupStore = GroupStore(self.mgr, 'default')
        self.accountsStore = AccountsStore(self.mgr, 'default',
                                           self.groupStore)

        self.defaultClient = self.clientStore.getDefaultClient()
コード例 #11
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.purchasing.stores.purchase_order import PurchaseOrderStore
        from saas.app.modules.inventory.stores.facility import FacilityStore
        from saas.app.modules.purchasing.stores.vendors import VendorStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientStore = ClientStore(self.mgr, 'default')
        self.poStore = PurchaseOrderStore(self.mgr, 'default')
        self.facilityStore = FacilityStore(self.mgr, 'default')
        self.vendorStore = VendorStore(self.mgr, 'default')

        self.defaultClient = self.clientStore.getDefaultClient()
コード例 #12
0
    def setUp(self):
        self.config = testing.setUp()

        from saas.app.core.services.connection import ConnectionManager
        from saas.app.modules.admin.stores.clients import ClientsStore
        from saas.app.core.stores.client import ClientStore
        from saas.app.modules.admin.stores.roles import RolesStore
        from saas.app.modules.admin.stores.users import UsersStore
        from saas.app.core.stores.user import UserStore

        self.mgr = ConnectionManager({'app.config': '../../etc'})
        self.clientsStore = ClientsStore(self.mgr, 'default')
        self.clientStore = ClientStore(self.mgr, 'default')
        self.rolesStore = RolesStore(self.mgr, 'default')
        self.usersStore = UsersStore(self.mgr, 'default')
        self.userStore = UserStore(self.mgr, 'default')

        self.defaultClient = self.clientStore.getDefaultClient()