mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
💚 Fix CI
This commit is contained in:
parent
c5f40e0952
commit
374e6ed7f8
@ -11,7 +11,6 @@ from django.utils import timezone
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.generic import DetailView, TemplateView, UpdateView
|
from django.views.generic import DetailView, TemplateView, UpdateView
|
||||||
from django_tables2.views import SingleTableView
|
from django_tables2.views import SingleTableView
|
||||||
|
|
||||||
from note.models import Alias, NoteSpecial, NoteUser
|
from note.models import Alias, NoteSpecial, NoteUser
|
||||||
from permission.backends import PermissionBackend
|
from permission.backends import PermissionBackend
|
||||||
from permission.views import ProtectQuerysetMixin, ProtectedCreateView
|
from permission.views import ProtectQuerysetMixin, ProtectedCreateView
|
||||||
|
@ -77,6 +77,7 @@ class ImageForm(forms.Form):
|
|||||||
width = forms.FloatField(widget=forms.HiddenInput())
|
width = forms.FloatField(widget=forms.HiddenInput())
|
||||||
height = forms.FloatField(widget=forms.HiddenInput())
|
height = forms.FloatField(widget=forms.HiddenInput())
|
||||||
|
|
||||||
|
|
||||||
class ClubForm(forms.ModelForm):
|
class ClubForm(forms.ModelForm):
|
||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super().clean()
|
cleaned_data = super().clean()
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
import io
|
import io
|
||||||
from datetime import timedelta, date
|
from datetime import timedelta, date
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth import logout
|
from django.contrib.auth import logout
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
@ -18,7 +18,6 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from django.views.generic import DetailView, UpdateView, TemplateView
|
from django.views.generic import DetailView, UpdateView, TemplateView
|
||||||
from django.views.generic.edit import FormMixin
|
from django.views.generic.edit import FormMixin
|
||||||
from django_tables2.views import SingleTableView
|
from django_tables2.views import SingleTableView
|
||||||
|
|
||||||
from rest_framework.authtoken.models import Token
|
from rest_framework.authtoken.models import Token
|
||||||
from note.models import Alias, NoteUser
|
from note.models import Alias, NoteUser
|
||||||
from note.models.transactions import Transaction, SpecialTransaction
|
from note.models.transactions import Transaction, SpecialTransaction
|
||||||
|
@ -10,7 +10,6 @@ from note_kfet.inputs import Autocomplete, AmountInput, DateTimePickerInput
|
|||||||
from .models import TransactionTemplate, NoteClub, Alias
|
from .models import TransactionTemplate, NoteClub, Alias
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TransactionTemplateForm(forms.ModelForm):
|
class TransactionTemplateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = TransactionTemplate
|
model = TransactionTemplate
|
||||||
|
@ -7,6 +7,7 @@ from django.contrib.auth.models import User
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.utils.crypto import get_random_string
|
||||||
from activity.models import Activity
|
from activity.models import Activity
|
||||||
from member.models import Club, Membership
|
from member.models import Club, Membership
|
||||||
from note.models import NoteUser
|
from note.models import NoteUser
|
||||||
@ -68,12 +69,12 @@ class TestPermissionDenied(TestCase):
|
|||||||
self.assertEqual(response.status_code, 403)
|
self.assertEqual(response.status_code, 403)
|
||||||
|
|
||||||
def test_add_member_club(self):
|
def test_add_member_club(self):
|
||||||
club = Club.objects.create()
|
club = Club.objects.create(name=get_random_string(127))
|
||||||
response = self.client.get(reverse("member:club_add_member", kwargs=dict(club_pk=club.pk)))
|
response = self.client.get(reverse("member:club_add_member", kwargs=dict(club_pk=club.pk)))
|
||||||
self.assertEqual(response.status_code, 403)
|
self.assertEqual(response.status_code, 403)
|
||||||
|
|
||||||
def test_renew_membership(self):
|
def test_renew_membership(self):
|
||||||
club = Club.objects.create()
|
club = Club.objects.create(name=get_random_string(127))
|
||||||
membership = Membership.objects.create(user=self.user, club=club)
|
membership = Membership.objects.create(user=self.user, club=club)
|
||||||
response = self.client.get(reverse("member:club_renew_membership", kwargs=dict(pk=membership.pk)))
|
response = self.client.get(reverse("member:club_renew_membership", kwargs=dict(pk=membership.pk)))
|
||||||
self.assertEqual(response.status_code, 403)
|
self.assertEqual(response.status_code, 403)
|
||||||
|
Loading…
Reference in New Issue
Block a user