mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
Exclude expired stock from builds
This commit is contained in:
@ -5,6 +5,8 @@ from django.urls import reverse
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@ -32,6 +34,9 @@ class StockViewTestCase(TestCase):
|
||||
password='password'
|
||||
)
|
||||
|
||||
self.user.is_staff = True
|
||||
self.user.save()
|
||||
|
||||
# Put the user into a group with the correct permissions
|
||||
group = Group.objects.create(name='mygroup')
|
||||
self.user.groups.add(group)
|
||||
@ -163,6 +168,9 @@ class StockItemTest(StockViewTestCase):
|
||||
and should be in the future!
|
||||
"""
|
||||
|
||||
# First, ensure that the expiry date feature is enabled!
|
||||
InvenTreeSetting.set_setting('STOCK_ENABLE_EXPIRY', True, self.user)
|
||||
|
||||
url = reverse('stock-item-create')
|
||||
|
||||
response = self.client.get(url, {'part': 25}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||
|
Reference in New Issue
Block a user