Compare commits
	
		
			3 Commits
		
	
	
		
			v1.6.0
			...
			aea9dcae79
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| aea9dcae79 | |||
| 40278eaf06 | |||
| e00c14f277 | 
| @@ -2,6 +2,14 @@ Change Log | ||||
| ========== | ||||
|  | ||||
|  | ||||
| Version 1.6.1 | ||||
| -------------- | ||||
|  | ||||
| Released 2024/12/3 | ||||
|  | ||||
| Fix test cases for compatibility with httpx 0.28.0. | ||||
|  | ||||
|  | ||||
| Version 1.6.0 | ||||
| -------------- | ||||
|  | ||||
|   | ||||
| @@ -43,7 +43,7 @@ dependencies = [ | ||||
|  | ||||
| [project.optional-dependencies] | ||||
| devel = [ | ||||
|     "httpx", | ||||
|     "httpx >= 0.20.0", | ||||
|     "OpenCC", | ||||
| ] | ||||
|  | ||||
|   | ||||
| @@ -24,7 +24,7 @@ from flask_sqlalchemy import SQLAlchemy | ||||
|  | ||||
| from accounting.utils.user import UserUtilityInterface | ||||
|  | ||||
| VERSION: str = "1.6.0" | ||||
| VERSION: str = "1.6.1" | ||||
| """The package version.""" | ||||
| db: SQLAlchemy = SQLAlchemy() | ||||
| """The database instance.""" | ||||
|   | ||||
| @@ -49,7 +49,7 @@ def create_app(is_testing: bool = False) -> Flask: | ||||
|     import accounting | ||||
|  | ||||
|     app: Flask = Flask(__name__) | ||||
|     db_uri: str = "sqlite:///" if is_testing else "sqlite:///local.sqlite" | ||||
|     db_uri: str = "sqlite://" if is_testing else "sqlite:///local.sqlite" | ||||
|     app.config.from_mapping({ | ||||
|         "SECRET_KEY": os.environ.get("SECRET_KEY", token_urlsafe(32)), | ||||
|         "SESSION_COOKIE_SAMESITE": "Lax", | ||||
|   | ||||
| @@ -67,8 +67,9 @@ class NextUriTestCase(unittest.TestCase): | ||||
|  | ||||
|         self.__app.add_url_rule("/test-next", view_func=test_next_uri_view, | ||||
|                                 methods=["GET", "POST"]) | ||||
|         client: httpx.Client = httpx.Client(app=self.__app, | ||||
|                                             base_url=TEST_SERVER) | ||||
|         client: httpx.Client = httpx.Client( | ||||
|             transport=httpx.WSGITransport(app=self.__app), | ||||
|             base_url=TEST_SERVER) | ||||
|         client.headers["Referer"] = TEST_SERVER | ||||
|         csrf_token: str = get_csrf_token(client) | ||||
|         response: httpx.Response | ||||
| @@ -96,8 +97,9 @@ class NextUriTestCase(unittest.TestCase): | ||||
|         self.__app.add_url_rule("/test-no-next", | ||||
|                                 view_func=test_no_next_uri_view, | ||||
|                                 methods=["GET", "POST"]) | ||||
|         client: httpx.Client = httpx.Client(app=self.__app, | ||||
|                                             base_url=TEST_SERVER) | ||||
|         client: httpx.Client = httpx.Client( | ||||
|             transport=httpx.WSGITransport(app=self.__app), | ||||
|             base_url=TEST_SERVER) | ||||
|         client.headers["Referer"] = TEST_SERVER | ||||
|         csrf_token: str = get_csrf_token(client) | ||||
|         response: httpx.Response | ||||
| @@ -122,8 +124,9 @@ class NextUriTestCase(unittest.TestCase): | ||||
|         self.__app.add_url_rule("/test-invalid-next", | ||||
|                                 view_func=test_invalid_next_uri_view, | ||||
|                                 methods=["GET", "POST"]) | ||||
|         client: httpx.Client = httpx.Client(app=self.__app, | ||||
|                                             base_url=TEST_SERVER) | ||||
|         client: httpx.Client = httpx.Client( | ||||
|             transport=httpx.WSGITransport(app=self.__app), | ||||
|             base_url=TEST_SERVER) | ||||
|         client.headers["Referer"] = TEST_SERVER | ||||
|         csrf_token: str = get_csrf_token(client) | ||||
|         next_uri: str | ||||
| @@ -227,8 +230,9 @@ class PaginationTestCase(unittest.TestCase): | ||||
|             self.assertEqual(pagination.list, self.__params.result) | ||||
|             return "" | ||||
|  | ||||
|         self.__client: httpx.Client = httpx.Client(app=self.__app, | ||||
|                                                    base_url=TEST_SERVER) | ||||
|         self.__client: httpx.Client = httpx.Client( | ||||
|             transport=httpx.WSGITransport(app=self.__app), | ||||
|             base_url=TEST_SERVER) | ||||
|         """The user client.""" | ||||
|         self.__client.headers["Referer"] = TEST_SERVER | ||||
|  | ||||
|   | ||||
| @@ -96,7 +96,9 @@ def get_client(app: Flask, username: str) -> httpx.Client: | ||||
|     :param username: The username. | ||||
|     :return: The user client. | ||||
|     """ | ||||
|     client: httpx.Client = httpx.Client(app=app, base_url=TEST_SERVER) | ||||
|     client: httpx.Client = httpx.Client( | ||||
|         transport=httpx.WSGITransport(app=app), | ||||
|         base_url=TEST_SERVER) | ||||
|     client.headers["Referer"] = TEST_SERVER | ||||
|     csrf_token: str = get_csrf_token(client) | ||||
|     with app.app_context(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user