def setUp(self): self.config = testing.setUp() setup_routes(self.config) self.session = setup_database() self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.session.flush()
def setUp(self): self.config = testing.setUp() setup_routes(self.config) self.session = setup_database() with transaction.manager: self.testuser = User(username='******', password='******') self.session.add(self.testuser)
def setUp(self): self.config = testing.setUp() self.session = setup_database() with transaction.manager: self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.testorder = models.Order(user=self.testuser.id, amount=2, method=models.Order.METHOD.BITCOIN, time=datetime.timedelta(days=30))
def setUp(self): self.config = testing.setUp() setup_routes(self.config) self.session = setup_database() self.paiduser = User(username='******', password='******') self.paiduser.add_paid_time(datetime.timedelta(days=30)) self.session.add(self.paiduser) self.session.flush() self.profile = Profile(uid=self.paiduser.id, name='testprofile') self.session.add(self.profile) self.freeuser = User(username='******', password='******') self.session.add(self.freeuser) duser = User(username='******', password='******') duser.is_active = False duser.add_paid_time(datetime.timedelta(days=30)) self.session.add(duser) self.gw0 = Gateway(name='gw0', token='simple_gateway', isp_name='', isp_url='', country='') self.session.add(self.gw0) self.gw1 = Gateway(name='gw1', token='disabled_gateway', isp_name='', isp_url='', country='') self.gw1.enabled = False self.session.add(self.gw1) self.gw2 = Gateway(name='gw2', token='ipv4_gateway', isp_name='', isp_url='', country='', ipv4='1.2.3.4') self.session.add(self.gw2) self.gw3 = Gateway(name='gw3', token='ipv6_gateway', isp_name='', isp_url='', country='', ipv6='1:2:3:4:5:6:7:8') self.session.add(self.gw3) self.session.flush() self.testheaders = { 'X-Gateway-Token': 'simple_gateway', 'X-Gateway-Version': 'alpha', }
def setUp(self): self.config = testing.setUp() self.session = setup_database() with transaction.manager: self.u = User(username='******', password='******') DBSession.add(self.u) self.pu = User(username='******', password='******') self.pu.add_paid_time(datetime.timedelta(days=30)) DBSession.add(self.pu)
def setUp(self): self.config = testing.setUp() self.session = setup_database() self.u = User(username='******', password='******') DBSession.add(self.u) self.session.flush() self.pu = User(username='******', password='******') self.pu.add_paid_time(datetime.timedelta(days=30)) DBSession.add(self.pu) self.session.flush()
def setUp(self): settings = {'mako.directories': 'ccvpn:templates/'} self.config = testing.setUp(settings=settings) setup_routes(self.config) self.session = setup_database() self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.session.flush() profile = Profile(uid=self.testuser.id, name='testprofile') self.session.add(profile) self.session.flush()
def setUp(self): settings = { 'mako.directories': 'ccvpn:templates/' } self.config = testing.setUp(settings=settings) setup_routes(self.config) self.session = setup_database() with transaction.manager: self.testuser = User(username='******', password='******') self.session.add(self.testuser) with transaction.manager: self.testcode = GiftCode(datetime.timedelta(days=7)) self.session.add(self.testcode)
def setUp(self): settings = { 'mako.directories': 'ccvpn:templates/' } self.config = testing.setUp(settings=settings) setup_routes(self.config) self.session = setup_database() self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.session.flush() profile = Profile(uid=self.testuser.id, name='testprofile') self.session.add(profile) self.session.flush()
def setUp(self): settings = {'mako.directories': 'ccvpn:templates/'} self.config = testing.setUp(settings=settings) setup_routes(self.config) self.session = setup_database() self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.testadmin = User(username='******', password='******') self.testadmin.is_admin = True self.session.add(self.testadmin) self.session.flush() self.testcode = GiftCode(datetime.timedelta(days=7)) self.session.add(self.testcode) self.session.flush()
def setUp(self): settings = { 'mail.default_sender': 'root@lo', 'mako.directories': 'ccvpn:templates/' } self.config = testing.setUp(settings=settings) setup_routes(self.config) self.config.include('pyramid_mailer.testing') self.session = setup_database() testuser = User(username='******', password='******', email='user@host') self.session.add(testuser) self.session.flush() self.token = PasswordResetToken(uid=testuser.id) self.session.add(self.token) self.session.flush()
def setUp(self): settings = { 'mail.default_sender': 'root@lo', 'mako.directories': 'ccvpn:templates/' } self.config = testing.setUp(settings=settings) setup_routes(self.config) self.config.include('pyramid_mailer.testing') self.session = setup_database() with transaction.manager: testuser = User(username='******', password='******', email='user@host') self.session.add(testuser) testuserw = User(username='******', password='******') self.session.add(testuserw)
def setUp(self): settings = { 'mako.directories': 'ccvpn:templates/' } self.config = testing.setUp(settings=settings) setup_routes(self.config) self.session = setup_database() self.testuser = User(username='******', password='******') self.session.add(self.testuser) self.testadmin = User(username='******', password='******') self.testadmin.is_admin = True self.session.add(self.testadmin) self.session.flush() self.testcode = GiftCode(datetime.timedelta(days=7)) self.session.add(self.testcode) self.session.flush()
def setUp(self): self.config = testing.setUp() setup_routes(self.config) self.session = setup_database() with transaction.manager: user = User(username='******', password='******') user.add_paid_time(datetime.timedelta(days=30)) baduser = User(username='******', password='******') self.session.add(user) self.session.add(baduser) with transaction.manager: token = APIAccessToken(token='apitoken') self.session.add(token) restricted_token = APIAccessToken(token='restricted_apitoken') restricted_token.remote_addr = '127.0.0.1' self.session.add(restricted_token) with transaction.manager: profile = Profile(uid=user.id, name='testprofile') self.session.add(profile)
def setUp(self): self.config = testing.setUp() self.session = setup_database() with transaction.manager: u = User(username='******', email='test@host', password='******') DBSession.add(u)
def setUp(self): self.config = testing.setUp() setup_routes(self.config) self.session = setup_database()
def setUp(self): self.config = testing.setUp() self.session = setup_database() u = User(username='******', email='test@host', password='******') DBSession.add(u) self.session.flush()