Files
mayan-edms/mayan/apps/checkouts/tests/mixins.py
Roberto Rosario 3a60155bfa Add checkout tests
Add link tests. Add checkout info view tests. Move common code to
a test mixin.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-07 01:08:46 -04:00

19 lines
524 B
Python

from __future__ import unicode_literals
import datetime
from django.utils.timezone import now
from ..models import DocumentCheckout
class DocumentCheckoutTestMixin(object):
def _checkout_document(self):
expiration_datetime = now() + datetime.timedelta(days=1)
DocumentCheckout.objects.checkout_document(
document=self.document, expiration_datetime=expiration_datetime,
user=self.user, block_new_version=True
)
self.assertTrue(self.document.is_checked_out())