-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix conflicts after merge from master
- Loading branch information
Showing
10 changed files
with
1,273 additions
and
1,589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/test_model_definition/test_through_model_relation_setup_on_clone.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import ormar | ||
import pytest | ||
|
||
from tests.lifespan import init_tests | ||
from tests.settings import create_config | ||
|
||
base_ormar_config = create_config() | ||
|
||
|
||
class Author(ormar.Model): | ||
ormar_config = base_ormar_config.copy(tablename="authors") | ||
|
||
id = ormar.Integer(primary_key=True) | ||
name = ormar.String(max_length=100) | ||
|
||
|
||
class Book(ormar.Model): | ||
ormar_config = base_ormar_config.copy(tablename="books") | ||
|
||
id = ormar.Integer(primary_key=True) | ||
title = ormar.String(max_length=100) | ||
author = ormar.ManyToMany( | ||
Author, | ||
) | ||
year = ormar.Integer(nullable=True) | ||
|
||
|
||
create_test_database = init_tests(base_ormar_config) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_tables_are_created(): | ||
async with base_ormar_config.database: | ||
assert await Book.objects.all() == [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters