Skip to content

Commit

Permalink
v0.12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
grigi committed Jul 10, 2019
1 parent e356351 commit 4bb36d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -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",
Expand Down
14 changes: 10 additions & 4 deletions tortoise/tests/test_bad_relation_reference.py
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down

0 comments on commit 4bb36d0

Please sign in to comment.