I wanted to run a custom unit test on a module from tom_base/tom_alerts (a customized TNS broker to be exact).
I ran all unit test available using ./manage.py test tom_alerts.tests
I ran into this issue:
(my_tom_env) katarzyna@KKruszynska-lt:~/my_tom/tom_base$ ./manage.py test tom_alerts.tests
Found 41 test(s).
Creating test database for alias 'default'...
registering new views: args: ('groups', <class 'tom_common.api_views.GroupViewSet'>, 'groups'), kwargs: {}
registering new views: args: ('targets', <class 'tom_targets.api_views.TargetViewSet'>, 'targets'), kwargs: {}
registering new views: args: ('targetextra', <class 'tom_targets.api_views.TargetExtraViewSet'>, 'targetextra'), kwargs: {}
registering new views: args: ('targetname', <class 'tom_targets.api_views.TargetNameViewSet'>, 'targetname'), kwargs: {}
registering new views: args: ('targetlist', <class 'tom_targets.api_views.TargetListViewSet'>, 'targetlist'), kwargs: {}
registering new views: args: ('observations', <class 'tom_observations.api_views.ObservationRecordViewSet'>, 'observations'), kwargs: {}
registering new views: args: ('dataproducts', <class 'tom_dataproducts.api_views.DataProductViewSet'>, 'dataproducts'), kwargs: {}
registering new views: args: ('reduceddatums', <class 'tom_dataproducts.api_views.ReducedDatumViewSet'>, 'reduceddatums'), kwargs: {}
System check identified no issues (0 silenced).
EE..................................Form invalid: <ul class="errorlist"><li>__all__<ul class="errorlist nonfield"><li>Must provide either Target or ObservationRecord to be submitted upstream.</li></ul></li></ul>
..Form invalid: <ul class="errorlist"><li>__all__<ul class="errorlist nonfield"><li>Must provide either Target or ObservationRecord to be submitted upstream.</li></ul></li></ul>
.Observation change state hook: test_target @ Test from None to
..
======================================================================
ERROR: tom_alerts.tests.brokers.test_alerce (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tom_alerts.tests.brokers.test_alerce
Traceback (most recent call last):
File "/usr/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/katarzyna/my_tom/tom_base/tom_alerts/tests/brokers/test_alerce.py", line 7, in <module>
from faker import Faker
ModuleNotFoundError: No module named 'faker'
======================================================================
ERROR: tom_alerts.tests.brokers.test_tns (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tom_alerts.tests.brokers.test_tns
Traceback (most recent call last):
File "/usr/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/katarzyna/my_tom/tom_base/tom_alerts/tests/brokers/test_tns.py", line 2, in <module>
from tom_targets.tests.factories import SiderealTargetFactory
File "/home/katarzyna/my_tom/tom_base/tom_targets/tests/factories.py", line 1, in <module>
import factory
ModuleNotFoundError: No module named 'factory'
I assume I have to install the 'faker' and the 'factory' libraries, but I assumed they would be recorded in the requirements file.
I wanted to run a custom unit test on a module from tom_base/tom_alerts (a customized TNS broker to be exact). I ran all unit test available using ./manage.py test tom_alerts.tests
I ran into this issue:
I assume I have to install the 'faker' and the 'factory' libraries, but I assumed they would be recorded in the requirements file.