Skip to content

Commit

Permalink
Merge branch 'release/4.0.9' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Feb 27, 2025
2 parents b454b06 + 376a22a commit 398cf5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions edc_visit_schedule/models/visit_schedule.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from decimal import Decimal

from django.db import models
from edc_model import models as edc_models

Expand Down Expand Up @@ -42,6 +44,11 @@ def natural_key(self):
self.visit_code,
)

def next_by_timepoint(self, timepoint: Decimal):
for obj in self.objects.filter(timepoint__gt=timepoint):
return obj
return None

class Meta(edc_models.BaseUuidModel.Meta):
# ordering = ("visit_schedule_name", "schedule_name", "visit_code")
unique_together = (
Expand Down
3 changes: 1 addition & 2 deletions edc_visit_schedule/tests/tests/test_visit_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import time_machine
from dateutil.relativedelta import relativedelta
from django.test import TestCase, override_settings, tag
from django.test import TestCase, override_settings
from edc_appointment.models import Appointment
from edc_consent.consent_definition import ConsentDefinition
from edc_consent.exceptions import NotConsentedError
Expand Down Expand Up @@ -282,7 +282,6 @@ def test_put_on_schedule_creates_history(self):
)
traveller.stop()

@tag("1")
def test_onschedule_creates_history(self):
traveller = time_machine.travel(self.study_open_datetime)
traveller.start()
Expand Down

0 comments on commit 398cf5c

Please sign in to comment.