File: tests-avoid-django-stubs-ext.patch

package info (click to toggle)
django-modeltranslation 0.19.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 992 kB
  • sloc: python: 5,820; javascript: 432; makefile: 154
file content (32 lines) | stat: -rw-r--r-- 890 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
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 10 Feb 2025 11:33:54 +0000
Subject: Avoid django_stubs_ext in tests

It isn't currently packaged in Debian, so inline the relevant part of
it.

Forwarded: not-needed
Last-Update: 2025-02-10
---
 modeltranslation/tests/settings.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modeltranslation/tests/settings.py b/modeltranslation/tests/settings.py
index 772b086..e2e70c2 100644
--- a/modeltranslation/tests/settings.py
+++ b/modeltranslation/tests/settings.py
@@ -1,11 +1,12 @@
 import os
 import warnings
 
-import django_stubs_ext
+from django.db.models.fields import Field
+
 from modeltranslation._typing import monkeypatch
 
 warnings.simplefilter("always", DeprecationWarning)
-django_stubs_ext.monkeypatch()
+Field.__class_getitem__ = classmethod(lambda Field, *args, **kwargs: Field)
 monkeypatch()