[Answered ]-Unit test in PyCharm fails if imported a class

1👍

This seem likely that your Django application is not totaly loaded.

You should try using django.setup() before trying to import the PocFunctional class

for example:

import django
from unittest import TestCase

class TestPocFunctional(TestCase):
    @classmethod
    def setUpClass(cls):
        django.setup() 
        from app.poc import PocFunctional
        cls.poc = PocFunctional()

    def test_get_transaction(self):

do your test transaction in the test_get_transaction method it should work

Leave a comment