diff --git a/tests/test_relations.py b/tests/test_relations.py index 87dc28451..da571717a 100644 --- a/tests/test_relations.py +++ b/tests/test_relations.py @@ -177,9 +177,11 @@ class TestSlugRelatedField(APISimpleTestCase): assert representation == self.instance.name def test_no_queryset_init(self): + qs = self.queryset + class NoQuerySetSlugRelatedField(serializers.SlugRelatedField): - def get_queryset(this): - return self.queryset + def get_queryset(self): + return qs field = NoQuerySetSlugRelatedField(slug_field='name') field.to_internal_value(self.instance.name)