Esempio n. 1
0
    def setUp(self):
        super().setUp()
        db.create_all()

        admin_role = Role(name='admin')
        self.user = User(
            username='******',
            email='*****@*****.**',
            password_hash=
            'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
            enabled=True)
        self.admin = User(
            username='******',
            email='*****@*****.**',
            password_hash=
            'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
            enabled=True,
            roles=[admin_role])
        self.try_add_entities([
            self.user, self.admin, admin_role,
            Currency(code='USD', rate=0.5),
            Currency(code='RUR', rate=0.5),
            Country(id='c1', name='country1'),
            Product(id='0000', name='Test product', price=10, weight=10)
        ])
Esempio n. 2
0
    def setUp(self):
        super().setUp()
        db.create_all()

        admin_role = Role(id=10, name='admin')
        self.try_add_entities([
            User(
                id=0,
                username='******',
                email='*****@*****.**',
                password_hash=
                'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
                enabled=True,
                roles=[admin_role]),
            User(
                id=10,
                username='******',
                email='*****@*****.**',
                password_hash=
                'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
                enabled=True),
            User(
                id=20,
                username='******',
                email='*****@*****.**',
                password_hash=
                'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
                enabled=True), admin_role,
            Currency()
        ])
Esempio n. 3
0
    def setUp(self):
        super().setUp()
        self.maxDiff = None

        db.create_all()
        admin_role = Role(id=10, name='admin')
        self.admin = User(
            id=0,
            username='******',
            email='*****@*****.**',
            password_hash=
            'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
            enabled=True,
            roles=[admin_role])
        self.user = User(
            id=10,
            username='******',
            email='*****@*****.**',
            password_hash=
            'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
            enabled=True)
        self.try_add_entities([
            admin_role, self.user, self.admin,
            User(
                id=20,
                username='******',
                email='*****@*****.**',
                password_hash=
                'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
                enabled=True),
            Order(id='test-api-admin-2', user_id=20)
        ])
Esempio n. 4
0
 def setUp(self):
     super().setUp()
     db.create_all()
     
     admin_role = Role(id=10, name='admin')
     self.user = User(id=10, username='******', email='*****@*****.**',
             password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576', 
             enabled=True)
     self.admin = User(username='******', email='*****@*****.**',
             password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
             enabled=True, roles=[admin_role])
     self.try_add_entities([ self.user, self.admin, admin_role ])
Esempio n. 5
0
 def setUp(self):
     super().setUp()
     db.create_all()
     
     admin_role = Role(name='admin')
     self.user = User(username='******', email='*****@*****.**',
         password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576', 
         enabled=True)
     self.admin = User(username='******', email='*****@*****.**',
         password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
         enabled=True, roles=[admin_role])
     self.try_add_entities([
         self.user, self.admin, admin_role,
         Currency(code='USD', rate=0.5),
         Currency(code='RUR', rate=0.5)
     ])
Esempio n. 6
0
 def setUp(self):
     super().setUp()
     db.create_all()
     
     admin_role = Role(id=10, name='admin')
     self.try_add_entities([
         User(username='******', email='*****@*****.**',
             password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
             enabled=True, roles=[admin_role]),
         User(id=10, username='******', email='*****@*****.**',
             password_hash='pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576', 
             enabled=True),
         admin_role,
         Country(id='c1', name='country1'),
         Currency(code='USD', rate=0.5),
         Product(id='SHIPPING', name='Shipping', weight=0, available=False,
             synchronize=False, separate_shipping=False, purchase=False)
     ])
Esempio n. 7
0
 def setUp(self):
     super().setUp()
     db.create_all()
     admin_role = Role(name='admin')
     self.user = User(
         username='******' + str(__name__),
         email='*****@*****.**',
         password_hash=
         'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
         enabled=True)
     self.admin = User(
         username='******' + str(__name__),
         email='*****@*****.**',
         password_hash=
         'pbkdf2:sha256:150000$bwYY0rIO$320d11e791b3a0f1d0742038ceebf879b8182898cbefee7bf0e55b9c9e9e5576',
         enabled=True,
         roles=[admin_role])
     self.try_add_entities([self.admin, self.user, admin_role])