Skip to content

Commit 10a1819

Browse files
committed
Run pre-commit
1 parent dc2282a commit 10a1819

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/contrib/django/testapp/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
import time
3535

3636
from django.contrib.auth.models import User
37+
from django.db import DatabaseError
38+
from django.db.models import QuerySet
3739
from django.http import HttpResponse, StreamingHttpResponse
3840
from django.shortcuts import get_object_or_404, render
3941
from django.views import View
40-
from django.db.models import QuerySet
41-
from django.db import DatabaseError
4242

4343
import elasticapm
4444

@@ -74,16 +74,18 @@ def django_exc(request):
7474

7575
def django_queryset_error(request):
7676
"""Simulation of django ORM timeout"""
77+
7778
class CustomQuerySet(QuerySet):
7879
def all(self):
7980
raise DatabaseError()
80-
81+
8182
def __repr__(self) -> str:
8283
return str(self._result_cache)
8384

8485
qs = CustomQuerySet()
8586
list(qs.all())
8687

88+
8789
def raise_exc(request):
8890
raise MyException(request.GET.get("message", "view exception"))
8991

0 commit comments

Comments
 (0)