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
Hi,
First of all, thanks for sharing this! Is simply amazing to be able to mock QuerySet in few simple lines!
Saying that, I am trying to replicate a ForeignKey relation and access to its attribute. I understand it might not be supported by the library but do you have any suggestion to replicate such behavior?
Thanks a lot
from django_mock_queries.query import MockSet, MockModel
OPERATOR = MockSet(
MockModel(
name="Name_1",
surname="Surname_1"
)
)
TICKETS = MockSet(
MockModel(
change_id=123456,
change_type="test",
status="implementation",
operator=OPERATOR,
date_diff=-10
),
)
for x in TICKETS.all():
op = x.operator_set.all()
print(op)
The above returns:
AttributeError: 'NoneType' object has no attribute 'all'
The text was updated successfully, but these errors were encountered:
Hi,
First of all, thanks for sharing this! Is simply amazing to be able to mock QuerySet in few simple lines!
Saying that, I am trying to replicate a
ForeignKey
relation and access to its attribute. I understand it might not be supported by the library but do you have any suggestion to replicate such behavior?Thanks a lot
The above returns:
AttributeError: 'NoneType' object has no attribute 'all'
The text was updated successfully, but these errors were encountered: