mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 06:21:58 +08:00
create monkeypatching function for adding get_item dunder (#526)
* run black * create monkeypatching function for adding get_item dunder * whoops i forgot the test * change the name in INSTALLED_APPS to make test pass * turn the whole thing into a proper package * move django_stubs_ext to requirements.txt * also install requirements.txt * attempt to fix pre-commit * numerous small code review fixes * fix dependency issues * small dependency fixes * configure proper license file location * add the rest of the monkeypatching * use strict mypy * update contributing with a note monkeypatching generics * copy release script from parent package
This commit is contained in:
11
django_stubs_ext/tests/test_monkeypatching.py
Normal file
11
django_stubs_ext/tests/test_monkeypatching.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import django_stubs_ext
|
||||
from django_stubs_ext.monkeypatch import _need_generic
|
||||
|
||||
django_stubs_ext.monkeypatch()
|
||||
|
||||
|
||||
def test_patched_generics() -> None:
|
||||
"""Test that the generics actually get patched."""
|
||||
for el in _need_generic:
|
||||
# This only throws an exception if the monkeypatch failed
|
||||
assert el.cls[type] == el.cls # `type` is arbitrary
|
||||
Reference in New Issue
Block a user