mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Move models into test modules, out of models module
This commit is contained in:
parent
fd84cf7f10
commit
773a92eab3
|
@ -58,13 +58,6 @@ class ReadOnlyManyToManyModel(RESTFrameworkModel):
|
||||||
rel = models.ManyToManyField(Anchor)
|
rel = models.ManyToManyField(Anchor)
|
||||||
|
|
||||||
|
|
||||||
# Model to test filtering.
|
|
||||||
class FilterableItem(RESTFrameworkModel):
|
|
||||||
text = models.CharField(max_length=100)
|
|
||||||
decimal = models.DecimalField(max_digits=4, decimal_places=2)
|
|
||||||
date = models.DateField()
|
|
||||||
|
|
||||||
|
|
||||||
# Model for regression test for #285
|
# Model for regression test for #285
|
||||||
|
|
||||||
class Comment(RESTFrameworkModel):
|
class Comment(RESTFrameworkModel):
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import datetime
|
import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import django
|
from django.db import models
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.test.client import RequestFactory
|
from django.test.client import RequestFactory
|
||||||
from django.utils import unittest
|
from django.utils import unittest
|
||||||
from rest_framework import generics, status, pagination, filters, serializers
|
from rest_framework import generics, status, pagination, filters, serializers
|
||||||
from rest_framework.compat import django_filters
|
from rest_framework.compat import django_filters
|
||||||
from rest_framework.tests.models import BasicModel, FilterableItem
|
from rest_framework.tests.models import BasicModel
|
||||||
|
|
||||||
factory = RequestFactory()
|
factory = RequestFactory()
|
||||||
|
|
||||||
|
|
||||||
|
class FilterableItem(models.Model):
|
||||||
|
text = models.CharField(max_length=100)
|
||||||
|
decimal = models.DecimalField(max_digits=4, decimal_places=2)
|
||||||
|
date = models.DateField()
|
||||||
|
|
||||||
|
|
||||||
class RootView(generics.ListCreateAPIView):
|
class RootView(generics.ListCreateAPIView):
|
||||||
"""
|
"""
|
||||||
Example description for OPTIONS.
|
Example description for OPTIONS.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user