예제 #1
0
    def setup(self):
        inject.clear_and_configure(configure_test)

        app.config["TESTING"] = True
        with app.test_client() as client:
            self.client = client
            self.user = self.setup_user()
            self.user_route = "/users"
            self.goods = self.setup_goods()
            self.good_route = "/goods"
            self.stores = self.setup_store()
            self.store_route = "/stores"
예제 #2
0
    def setup(self):
        inject.clear_and_configure(configure_test)

        app.config['TESTING'] = True
        with app.test_client() as client:
            self.client = client
예제 #3
0
 def setup_store():
     client = app.test_client()
     user_route = "/users"
     resp = client.post(user_route, json={"name": "John Doe"})
     user_id = resp.json["user_id"]
     return {"name": "Mad Cow", "location": "Lviv", "manager_id": user_id}