mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 17:11:09 -05:00
fixed a bunch of things, hopefully didn't break things
This commit is contained in:
@@ -14,6 +14,7 @@ from companies.models import Company
|
||||
from django.views.generic import DetailView
|
||||
from django.test import RequestFactory
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@@ -28,7 +29,7 @@ class TestView(EditSubmissionMixin, PhotoSubmissionMixin, InlineEditMixin, Histo
|
||||
self.object = self.get_object()
|
||||
return super().get_context_data(**kwargs)
|
||||
|
||||
def setup(self, request, *args, **kwargs):
|
||||
def setup(self, request: HttpRequest, *args, **kwargs):
|
||||
super().setup(request, *args, **kwargs)
|
||||
self.request = request
|
||||
|
||||
@@ -224,8 +225,7 @@ class ModerationMixinsTests(TestCase):
|
||||
def test_moderator_required_mixin(self):
|
||||
"""Test moderator required mixin"""
|
||||
class TestModeratorView(ModeratorRequiredMixin):
|
||||
def __init__(self):
|
||||
self.request = None
|
||||
pass
|
||||
|
||||
view = TestModeratorView()
|
||||
|
||||
@@ -253,8 +253,7 @@ class ModerationMixinsTests(TestCase):
|
||||
def test_admin_required_mixin(self):
|
||||
"""Test admin required mixin"""
|
||||
class TestAdminView(AdminRequiredMixin):
|
||||
def __init__(self):
|
||||
self.request = None
|
||||
pass
|
||||
|
||||
view = TestAdminView()
|
||||
|
||||
@@ -319,7 +318,7 @@ class ModerationMixinsTests(TestCase):
|
||||
EditSubmission.objects.create(
|
||||
user=self.user,
|
||||
content_type=ContentType.objects.get_for_model(Company),
|
||||
object_id=self.company.id,
|
||||
object_id=getattr(self.company, 'id', None),
|
||||
submission_type='EDIT',
|
||||
changes={'name': 'New Name'},
|
||||
status='APPROVED'
|
||||
|
||||
Reference in New Issue
Block a user