Closed 868jjm closed 1 year ago
Hello @868jjm ,
In looking at your logs it seems that your virtual environment is not correctly installed or is not activated. I've updated the installation section so you can get a working project going.
https://github.com/arrobalytics/django-ledger#installation
Please let me know if this helps. Miguel
Traceback (most recent call last): File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\tests\test_purchase_order.py", line 43, in test_protected_views po_model = self.create_purchase_order(entity_model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\tests\test_purchase_order.py", line 27, in create_purchase_order po_model = po_model.configure(entity_slug=entity_model, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\models\purchase_order.py", line 320, in configure self.clean_fields() File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\db\models\base.py", line 1527, in clean_fields raise ValidationError(errors) django.core.exceptions.ValidationError: {'po_title': ['This field cannot be null.']}
Traceback (most recent call last): File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\tests\test_purchase_order.py", line 116, in test_purchase_order_create redirect_response = self.CLIENT.post(po_create_url, data={'po_title': po_title}, follow=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\client.py", line 948, in post response = super().post( ^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\client.py", line 482, in post return self.generic( ^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\client.py", line 609, in generic return self.request(r) ^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\client.py", line 891, in request self.check_exception(response) File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\client.py", line 738, in check_exception raise exc_value File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\views\generic\base.py", line 104, in view return self.dispatch(request, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\contrib\auth\mixins.py", line 109, in dispatch return super().dispatch(request, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\contrib\auth\mixins.py", line 73, in dispatch return super().dispatch(request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\views\generic\base.py", line 143, in dispatch return handler(request, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\views\generic\edit.py", line 184, in post return super().post(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\views\generic\edit.py", line 153, in post return self.form_valid(form) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\views\purchase_order.py", line 135, in form_valid po_model = po_model.configure( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\models\purchase_order.py", line 320, in configure self.clean_fields() File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\db\models\base.py", line 1527, in clean_fields raise ValidationError(errors) django.core.exceptions.ValidationError: {'po_title': ['This field cannot be null.']}
Traceback (most recent call last): File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\tests\test_bill.py", line 315, in test_bill_detail with self.assertNumQueries(5): File "C:\Users\868jjm.virtualenvs\django-ledger-DBZC_vQ-\Lib\site-packages\django\test\testcases.py", line 99, in exit self.test_case.assertEqual( AssertionError: 16 != 5 : 16 queries executed, 5 expected Captured queries were:
Traceback (most recent call last): File "C:\Users\868jjm\Documents\django-ledger3\django-ledger\django_ledger\tests\test_entity.py", line 58, in test_protected_views self.assertEqual(redirect_path, login_path, AssertionError: '/auth/login/' != '/accounts/login/'
Ran 19 tests in 72.275s
FAILED (failures=2, errors=2) Destroying test database for alias 'default'...
The PurchaseOrderModel tests need to be updated to accommodate some API changes. PR #149 fixes this bug and will be merged shortly. You may check out Branch v0.5.4.2 or wait until the development branch is updated.
Describe the bug After I Set Up Django Ledger for Development. I get to:
python manage.py test django_ledger
And when I run it i get an error. (django-ledger-rXgOjIEC) C:\Users\qwerty\Documents\django-ledger2\django-ledger>python manage.py test django_ledger Traceback (most recent call last): File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 11, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 22, in
main()
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 13, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
To Reproduce Steps to reproduce the behavior:
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 22, in
main()
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 13, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Expected behavior A working demo.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):