Commit 8a63e837 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

fix payment_start

parent 3dd9cc8f
......@@ -10,7 +10,8 @@ RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \
libgdal28 \
netcat \
&& python -m pip install -U pip \
&& python -m pip install -U -r requirements.prod.txt
&& python -m pip install -U -r requirements.prod.txt \
&& python -m pip install coverage
ADD . .
CMD while ! nc -z postgres 5432; do sleep 1; done \
......
from django.contrib.auth.models import User
from django.urls import reverse
from django.test import TestCase
from .forms import UserForm, ProfileForm
from adhesion.models import User
class ViewsTestCase(TestCase):
......
......@@ -28,7 +28,7 @@ class ActiveAdhesionManager(models.Manager):
payment_start=models.Subquery(
PaymentUpdate.objects.filter(
payment=models.OuterRef("membership__pk")
).values("payment_start")[:1]
).values("start")[:1]
),
active=models.Case(
models.When(payment_method__isnull=True, then=None),
......
......@@ -23,9 +23,6 @@ class AdhesionsMixin:
email="user@example.net",
password="user",
)
Adhesion.objects.create(
adherent_type=ContentType.objects.get_for_model(User), adherent_id=user.pk
)
corp1 = Corporation.objects.create(social_reason="GoodCorp")
corp1.members.add(user)
Corporation.objects.create(social_reason="EvilCorp")
......
......@@ -20,7 +20,7 @@ class CurrentPaymentManager(models.Manager):
payment_start=models.Subquery(
PaymentUpdate.objects.filter(
payment=models.OuterRef("pk"), validated=True
).values("payment_start")[:1]
).values("start")[:1]
),
long_stopped=models.Case(
models.When(
......
from django.contrib.auth.models import User
from django.urls import reverse
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
......@@ -8,7 +7,7 @@ from django.core.management.base import CommandError
from io import StringIO
from adhesions.models import Adhesion, Corporation
from adhesions.models import Adhesion, Corporation, User
from .models import Service, ServiceType, IPResource, ResourceAllocation
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment