2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 19:45:46 +00:00
Files
InvenTree/InvenTree/plugins/samples/integration/test_samples_integration.py
Matthias 9469c17be1 refactor
2021-09-29 00:56:01 +02:00

22 lines
736 B
Python

""" Unit tests for action plugins """
from django.test import TestCase
from django.contrib.auth import get_user_model
class SampleIntegrationPluginTests(TestCase):
""" Tests for SampleIntegrationPlugin """
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_view(self):
"""check the function of the custom sample plugin """
respone = self.client.get('/plugin/SampleIntegrationPlugin/ho/he/')
self.assertEqual(respone.status_code, 200)
self.assertEqual(respone.content, b'Hi there testuser this work')