File: test_reverse.py

package info (click to toggle)
django-ninja 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 11,280 kB
  • sloc: python: 15,956; javascript: 1,689; makefile: 39; sh: 25
file content (14 lines) | stat: -rw-r--r-- 323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest
from django.urls import reverse


@pytest.mark.parametrize(
    "view_name, path",
    [
        ("foobar", "/api/v3/foobar"),
        ("post_foobar", "/api/v3/foobar"),
        ("foobar_put", "/api/v3/foobar"),
    ],
)
def test_reverse(view_name, path):
    assert reverse(f"api-3.0.0:{view_name}") == path