Пример #1
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
                                             os.path.join('../', TEST_DB)
     self.app = app.test_client()
Пример #2
0
    def setUp(self):
        app.config['TESTING'] = True
        app.config['WTF_CSRF_ENABLED'] = False
        app.config['DEBUG'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../'+ TEST_DB
        self.app = app.test_client()

        response = self.app.post('/api/user/login/', data=json.dumps(
            dict(username="******", password="******")),
                                 content_type='application/json', follow_redirects=True)
        self.assertIn('/dashboard', str(response.data))