diff --git a/tests/test_query.py b/tests/test_query.py index 95514d6..b8582a4 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -1356,3 +1356,11 @@ def test_empty_queryset_filter(self): mockset = MockSet(car1, car2) self.assertEqual(mockset.count(), 2) self.assertEqual(mockset.filter(Q()).count(), 2) + + def test_mock_model_annotation_by_nested_field(): + mockset = MockSet( + MockModel(id=1, nested_mock=MockModel(id=1, field1="field_value")) + ) + field1 = mockset.annotate(field1=models.F("nested_mock__field1")).values_list("field1")[0][0] + + assert field1 == "field_value" \ No newline at end of file