2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 15:34:15 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into style-fixes

This commit is contained in:
Matthias Mair
2022-05-21 23:57:41 +02:00
28 changed files with 296 additions and 483 deletions

View File

@ -1,20 +1,15 @@
""" Unit tests for action plugins """
from django.contrib.auth import get_user_model
from django.test import TestCase
from InvenTree.helpers import InvenTreeTestCase
from plugin.builtin.action.simpleactionplugin import SimpleActionPlugin
class SimpleActionPluginTests(TestCase):
class SimpleActionPluginTests(InvenTreeTestCase):
""" Tests for SampleIntegrationPlugin """
def setUp(self):
# Create a user for auth
user = get_user_model()
self.test_user = user.objects.create_user('testuser', 'test@testing.com', 'password')
super().setUp()
self.client.login(username='testuser', password='password')
self.plugin = SimpleActionPlugin()
def test_name(self):
@ -33,7 +28,7 @@ class SimpleActionPluginTests(TestCase):
"action": 'simple',
"result": True,
"info": {
"user": "testuser",
"user": self.username,
"hello": "world",
},
}

View File

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
"""Unit tests for InvenTreeBarcodePlugin"""
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from InvenTree.api_tester import InvenTreeAPITestCase
class TestInvenTreeBarcode(APITestCase):
class TestInvenTreeBarcode(InvenTreeAPITestCase):
fixtures = [
'category',
@ -17,13 +17,6 @@ class TestInvenTreeBarcode(APITestCase):
'stock'
]
def setUp(self):
# Create a user for auth
user = get_user_model()
user.objects.create_user('testuser', 'test@testing.com', 'password')
self.client.login(username='testuser', password='password')
def test_errors(self):
"""
Test all possible error cases for assigment action