'Test that trying to use ModelSerializer with Abstract Models
throws a ValueError exception.'

def test_abstract_model(self):

    class AbstractModel(models.Model, ):
        afield = models.CharField(max_length=255)
        class Meta:
            abstract = True
    class TestSerializer(serializers.ModelSerializer, ):
        class Meta:
            model = AbstractModel
            fields = (u'afield',)
    serializer = TestSerializer(data={u'afield': u'foo'})
    with self.assertRaises(ValueError) as excinfo:
        serializer.is_valid()
    msginitial = u'Cannot    use    ModelSerializer    with    Abstract    Models.'
    assert str(excinfo.exception).startswith(msginitial)
