mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-11 15:34:15 +00:00
more class use
This commit is contained in:
@ -1,20 +1,15 @@
|
||||
""" Unit tests for action plugins """
|
||||
|
||||
from django.test import TestCase
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from InvenTree.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",
|
||||
},
|
||||
}
|
||||
|
@ -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.test import APITestCase
|
||||
from rest_framework import status
|
||||
|
||||
from InvenTree.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
|
||||
|
Reference in New Issue
Block a user