Truncate all tables in the given context.
(ctx)
| 29 | |
| 30 | |
| 31 | async def _truncate_all_tables(ctx) -> None: |
| 32 | """Truncate all tables in the given context.""" |
| 33 | if ctx.apps: |
| 34 | for model in ctx.apps.get_models_iterable(): |
| 35 | quote_char = model._meta.db.query_class.SQL_CONTEXT.quote_char |
| 36 | await model._meta.db.execute_script( |
| 37 | f"DELETE FROM {quote_char}{model._meta.db_table}{quote_char}" # nosec |
| 38 | ) |
| 39 | |
| 40 | |
| 41 | # ============================================================================ |
no test coverage detected
searching dependent graphs…