diff --git a/setup.py b/setup.py index 0fd4dce73..bd9e5f14a 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ def requirements() -> list: url="https://github.com/tortoise/tortoise-orm", description="Easy async ORM for python, built with relations in mind", long_description=open("README.rst", "r").read(), + long_description_content_type="text/x-rst", project_urls={"Documentation": "https://tortoise-orm.readthedocs.io/"}, classifiers=[ "License :: OSI Approved :: Apache Software License", diff --git a/tortoise/tests/test_bad_relation_reference.py b/tortoise/tests/test_bad_relation_reference.py index 303b16622..3afd09ca2 100644 --- a/tortoise/tests/test_bad_relation_reference.py +++ b/tortoise/tests/test_bad_relation_reference.py @@ -18,7 +18,7 @@ async def tearDown(self): await Tortoise._reset_apps() async def test_wrong_app_init(self): - with self.assertRaises(ConfigurationError): + with self.assertRaisesRegex(ConfigurationError, "No app with name 'app' registered."): await Tortoise.init( { "connections": { @@ -37,7 +37,9 @@ async def test_wrong_app_init(self): ) async def test_wrong_model_init(self): - with self.assertRaises(ConfigurationError): + with self.assertRaisesRegex( + ConfigurationError, "No model with name 'Tour' registered in app 'models'." + ): await Tortoise.init( { "connections": { @@ -56,7 +58,9 @@ async def test_wrong_model_init(self): ) async def test_no_app_in_reference_init(self): - with self.assertRaises(ConfigurationError): + with self.assertRaisesRegex( + ConfigurationError, 'Foreign key accepts model name in format "app.Model"' + ): await Tortoise.init( { "connections": { @@ -75,7 +79,9 @@ async def test_no_app_in_reference_init(self): ) async def test_more_than_two_dots_in_reference_init(self): - with self.assertRaises(ConfigurationError): + with self.assertRaisesRegex( + ConfigurationError, 'Foreign key accepts model name in format "app.Model"' + ): await Tortoise.init( { "connections": {