File: test_deprecations.py

package info (click to toggle)
python-odmantic 1.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,640 kB
  • sloc: python: 8,547; sh: 37; makefile: 34; xml: 13; javascript: 3
file content (38 lines) | stat: -rw-r--r-- 717 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pytest

from odmantic import EmbeddedModel, Model


class M(Model): ...


def test_deprecated_copy():
    with pytest.deprecated_call():
        M().copy()


def test_deprecated_update():
    with pytest.deprecated_call():
        M().update({})


def test_deprecated_update_basemodel():
    # EmbeddedModel is a subclass of BaseModel not redefine update
    class E(EmbeddedModel): ...

    with pytest.deprecated_call():
        E().update({})


def test_deprecated_doc():
    with pytest.deprecated_call():
        M().doc()


def test_deprecated_parse_doc():
    with pytest.deprecated_call():
        M().parse_doc(
            {
                "_id": "5f8352a87a733b8b18b0cb27",
            }
        )