<filename>InvenTree/plugin/samples/integration/test_api_caller.py
""" Unit tests for action caller sample"""

from django.test import TestCase

from plugin import registry


class SampleApiCallerPluginTests(TestCase):
    """ Tests for SampleApiCallerPluginTests """

    def test_return(self):
        """check if the external api call works"""
        # The plugin should be defined
        self.assertIn('sample-api-caller', registry.plugins)
        plg = registry.plugins['sample-api-caller']
        self.assertTrue(plg)

        # do an api call
        result = plg.get_external_url()
        self.assertTrue(result)
        self.assertIn('data', result,)

<filename>InvenTree/plugin/samples/integration/test_api_caller.py
""" Unit tests for action caller sample"""

from django.test import TestCase

from plugin import registry


class SampleApiCallerPluginTests(TestCase):
    """ Tests for SampleApiCallerPluginTests """

    def test_return(self):
        """check if the external api call works"""
        # The plugin should be defined
        self.assertIn('sample-api-caller', registry.plugins)
        plg = registry.plugins['sample-api-caller']
        self.assertTrue(plg)

        # do an api call
        result = plg.get_external_url()
        self.assertTrue(result)
        self.assertIn('data', result,)

Unit tests for action caller sample Tests for SampleApiCallerPluginTests check if the external api call works # The plugin should be defined # do an api call