From 27430b89db0608e8fdf26204c7df300ec04c5d3a Mon Sep 17 00:00:00 2001 From: Bernardo Heynemann Date: Mon, 9 May 2011 23:18:06 -0300 Subject: [PATCH] CRUD done for strings --- Makefile | 2 +- django_pyvows/model_assertions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 460eb9c..5b0680b 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,4 @@ pyvows: @env PYTHONPATH=$$PYTHONPATH:. pyvows --cover --cover_package=django_pyvows --cover_threshold=100 vows/ db: - @env PYTHONPATH=$$PYTHONPATH:. mysql -u root -e 'CREATE DATABASE IF NOT EXISTS django_pyvows' && python vows/sandbox/manage.py syncdb + @env PYTHONPATH=$$PYTHONPATH:. mysql -u root -e 'DROP DATABASE IF EXISTS django_pyvows' && mysql -u root -e 'CREATE DATABASE IF NOT EXISTS django_pyvows' && python vows/sandbox/manage.py syncdb diff --git a/django_pyvows/model_assertions.py b/django_pyvows/model_assertions.py index d22675c..312cca9 100644 --- a/django_pyvows/model_assertions.py +++ b/django_pyvows/model_assertions.py @@ -33,8 +33,8 @@ def to_be_cruddable(topic): assert getattr(updated, field.name) != getattr(instance, field.name), "The instance should have been updated but the field %s is the same in both the original instance and the updated one (%s)." % (field.name, getattr(updated, field.name)) - topic.model.objects.delete(id=instance.id) - object_count = topic.mode.objects.count() + instance.delete() + object_count = topic.model.objects.count() assert object_count == 0, "Object should have been deleted, but it wasn't (count: %d)" % object_count def __create_instance(topic):