2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00
InvenTree/InvenTree/plugin/samples/integration/test_samples_integration.py
2021-11-15 07:47:52 +01:00

22 lines
723 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 """
response = self.client.get('/plugin/sample/ho/he/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, b'Hi there testuser this works')