Remove bank, Kfet and add BDA and BDS (need to fix activity, permission and registration)
This commit is contained in:
parent
3a3e3be64c
commit
838bd2bb23
43 changed files with 128 additions and 639 deletions
|
|
@ -11,7 +11,7 @@ from django.test import TestCase
|
|||
from django.utils import timezone
|
||||
from member.models import Club, Membership
|
||||
from note.models import NoteUser, Note, NoteClub, NoteSpecial
|
||||
from wei.models import WEIMembership, WEIRegistration, WEIClub, Bus, BusTeam
|
||||
|
||||
|
||||
from ..models import Permission
|
||||
|
||||
|
|
@ -23,44 +23,16 @@ class PermissionQueryTestCase(TestCase):
|
|||
def setUpTestData(cls):
|
||||
user = User.objects.create(username="user")
|
||||
NoteUser.objects.create(user=user)
|
||||
wei = WEIClub.objects.create(
|
||||
name="wei",
|
||||
date_start=date.today(),
|
||||
date_end=date.today(),
|
||||
)
|
||||
NoteClub.objects.create(club=wei)
|
||||
weiregistration = WEIRegistration.objects.create(
|
||||
user=user,
|
||||
wei=wei,
|
||||
birth_date=date.today(),
|
||||
)
|
||||
bus = Bus.objects.create(
|
||||
name="bus",
|
||||
wei=wei,
|
||||
)
|
||||
team = BusTeam.objects.create(
|
||||
name="team",
|
||||
bus=bus,
|
||||
color=0xFFFFFF,
|
||||
)
|
||||
WEIMembership.objects.create(
|
||||
user=user,
|
||||
club=wei,
|
||||
registration=weiregistration,
|
||||
bus=bus,
|
||||
team=team,
|
||||
)
|
||||
|
||||
def test_permission_queries(self):
|
||||
"""
|
||||
Check for all permissions that the query is compilable and that the database can parse the query.
|
||||
We use a random user with a random WEIClub (to use permissions for the WEI) in a random team in a random bus.
|
||||
We use a random user.
|
||||
"""
|
||||
for perm in Permission.objects.all():
|
||||
try:
|
||||
instanced = perm.about(
|
||||
user=User.objects.get(),
|
||||
club=WEIClub.objects.get(),
|
||||
membership=Membership.objects.get(),
|
||||
User=User,
|
||||
Club=Club,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue