Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for sql (0.12 sec)

  1. docs/en/docs/advanced/testing-database.md

    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    !!! tip
        The code for `override_get_db()` is almost exactly the same as for `get_db()`, but in `override_get_db()` we use the `TestingSessionLocal` for the testing database instead.
    
    ## Test the app
    
    Then we can just test the app as normally.
    
    ```Python hl_lines="32-47"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  2. docs/em/docs/advanced/testing-database.md

    ```
    
    👈 🛎 🤙 `main.py`, ✋️ ⏸ `main.py` ⚙️ 💽 📁 `sql_app.db`, & 👥 💪 ⚒ 💭 👥 ✍ `test.db` 💯.
    
    👥 🚮 👈 ⏸ 📥, ⏮️ 🆕 📁.
    
    ```Python hl_lines="16"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    ## 🔗 🔐
    
    🔜 👥 ✍ 🔗 🔐 & 🚮 ⚫️ 🔐 👆 📱.
    
    ```Python hl_lines="19-24  27"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/testing-database.md

    ```
    
    一般是在 `main.py` 中调用这行代码,但在 `main.py` 里,这行代码用于创建 `sql_app.db`,但是现在要为测试创建 `test.db`。
    
    因此,要在测试代码中添加这行代码创建新的数据库文件。
    
    ```Python hl_lines="16"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    ## 覆盖依赖项
    
    接下来,创建覆盖依赖项,并为应用添加覆盖内容。
    
    ```Python hl_lines="19-24  27"
    {!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
    ```
    
    !!! tip "提示"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jan 28 18:09:26 GMT 2024
    - 2.8K bytes
    - Viewed (0)
Back to top