You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/stefan/temp/intro/mysite/polls/tests/test_default.py", line 43, in test2
print(Question.objects.filter(slot__isnull=False))
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/query.py", line 126, in filter
return MockSet(*matches(*results, **attrs), clone=self)
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/utils.py", line 213, in matches
disqualified = [x for x in source if is_disqualified(x, attrs, negated)]
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/utils.py", line 213, in <listcomp>
disqualified = [x for x in source if is_disqualified(x, attrs, negated)]
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/utils.py", line 202, in is_disqualified
attr_value, comparison = get_attribute(obj, attr_name)
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/utils.py", line 124, in get_attribute
validate_field(attr_part, lookup_fields)
File "/home/stefan/temp/intro/venv/lib/python3.6/site-packages/django_mock_queries/utils.py", line 91, in validate_field
raise FieldError(message)
django.core.exceptions.FieldError: Cannot resolve keyword 'slot' into field. Choices are 'choice', 'id', 'pub_date', 'question_text', 'slots'.
Suppose we have two models: Patient and Slot.
And then we need to filter patients by related slot.
It's simple and working code. But when we try to mock
get_patients
with MockSet of patients created with fabric we get an error.If we change filter to
slots__email__isnull=True
, it works in tests. But now we get an error in Django shell.It would be great to fix this! Thanks. 😊
The text was updated successfully, but these errors were encountered: