Automatically test new models #3

Closed
opened 2011-05-06 13:03:08 +00:00 by heynemann · 0 comments
heynemann commented 2011-05-06 13:03:08 +00:00 (Migrated from github.com)

I would like to be able to test my models like:

from django_pyvows import DjangoContext, Assertions

from MyProject.models import MyModel

class MyModels(DjangoContext):

    def topic(self):
        return MyModel

    def should_crud_properly(self, topic):
        expect(topic).to_crud()

    def should_crud_properly_with_default_values(self, topic):
        expect(topic).to_crud({
            'field': 10,
            'other': 'some string',
            'something.other': 'sub-property'
        })

To test crud you should create a new instance, retrieve that instance, update that instance and delete the instance.

I would like to be able to test my models like: ``` from django_pyvows import DjangoContext, Assertions from MyProject.models import MyModel class MyModels(DjangoContext): def topic(self): return MyModel def should_crud_properly(self, topic): expect(topic).to_crud() def should_crud_properly_with_default_values(self, topic): expect(topic).to_crud({ 'field': 10, 'other': 'some string', 'something.other': 'sub-property' }) ``` To test crud you should create a new instance, retrieve that instance, update that instance and delete the instance.
This repo is archived. You cannot comment on issues.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archive/django-pyvows#3
No description provided.