Test that default values are correctly applied when inserting via raw SQL.
(default_row)
| 51 | |
| 52 | @pytest.mark.asyncio |
| 53 | async def test_default(default_row): |
| 54 | """Test that default values are correctly applied when inserting via raw SQL.""" |
| 55 | default_model = await DefaultModel.first() |
| 56 | assert default_model.int_default == 1 |
| 57 | assert default_model.float_default == 1.5 |
| 58 | assert default_model.decimal_default == Decimal(1) |
| 59 | assert default_model.bool_default |
| 60 | assert default_model.char_default == "tortoise" |
| 61 | assert default_model.date_default == datetime.date(year=2020, month=5, day=21) |
| 62 | assert default_model.datetime_default == datetime.datetime( |
| 63 | year=2020, month=5, day=20, tzinfo=UTC |
| 64 | ) |
nothing calls this directly
no test coverage detected
searching dependent graphs…