File: test_compatibility.py

package info (click to toggle)
djangorestframework-api-key 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: python: 926; makefile: 53; sh: 3
file content (18 lines) | stat: -rw-r--r-- 551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import django
import pytest

import rest_framework_api_key


@pytest.mark.skipif(
    django.VERSION < (3, 2), reason="app config is automatically defined by django"
)
def test_app_config_not_defined() -> None:  # pragma: no cover
    assert hasattr(rest_framework_api_key, "default_app_config") is False


@pytest.mark.skipif(
    django.VERSION >= (3, 2), reason="app config is not automatically defined by django"
)
def test_app_config_defined() -> None:  # pragma: no cover
    assert hasattr(rest_framework_api_key, "default_app_config") is True