mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Tweaks
This commit is contained in:
parent
6eaec7a0ec
commit
8ec54e6a9f
|
@ -344,7 +344,7 @@ class ManyRelatedField(ManyRelatedMixin, RelatedField):
|
||||||
"""
|
"""
|
||||||
Base class for related model managers.
|
Base class for related model managers.
|
||||||
|
|
||||||
If not overridden, this represents a to-many relatinship, using the unicode
|
If not overridden, this represents a to-many relationship, using the unicode
|
||||||
representations of the target, and is read-only.
|
representations of the target, and is read-only.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -32,10 +32,10 @@ def main():
|
||||||
'Function-based test runners are deprecated. Test runners should be classes with a run_tests() method.',
|
'Function-based test runners are deprecated. Test runners should be classes with a run_tests() method.',
|
||||||
DeprecationWarning
|
DeprecationWarning
|
||||||
)
|
)
|
||||||
failures = TestRunner(['rest_framework'])
|
failures = TestRunner(['tests'])
|
||||||
else:
|
else:
|
||||||
test_runner = TestRunner()
|
test_runner = TestRunner()
|
||||||
failures = test_runner.run_tests(['rest_framework'])
|
failures = test_runner.run_tests(['tests'])
|
||||||
cov.stop()
|
cov.stop()
|
||||||
|
|
||||||
# Discover the list of all modules that we should test coverage for
|
# Discover the list of all modules that we should test coverage for
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ForeignKeySource(models.Model):
|
||||||
|
|
||||||
|
|
||||||
class ForeignKeyTargetSerializer(serializers.ModelSerializer):
|
class ForeignKeyTargetSerializer(serializers.ModelSerializer):
|
||||||
sources = serializers.ManyPrimaryKeyRelatedField(queryset=ForeignKeySource.objects.all())
|
sources = serializers.ManyPrimaryKeyRelatedField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ForeignKeyTarget
|
model = ForeignKeyTarget
|
||||||
|
|
Loading…
Reference in New Issue
Block a user