removing empty update exception

This commit is contained in:
Blake Eggleston
2013-10-24 17:14:00 -07:00
parent a7c7a85a35
commit 1aa65768f0
2 changed files with 2 additions and 6 deletions

View File

@@ -756,7 +756,7 @@ class ModelQuerySet(AbstractQuerySet):
def update(self, **values):
""" Updates the rows in this queryset """
if not values:
raise ValidationError("At least one column needs to be updated")
return
set_statements = []
ctx = {}

View File

@@ -1,5 +1,6 @@
from uuid import uuid4
from cqlengine.exceptions import ValidationError
from cqlengine.query import QueryException
from cqlengine.tests.base import BaseCassEngTestCase
from cqlengine.models import Model
@@ -62,11 +63,6 @@ class QueryUpdateTests(BaseCassEngTestCase):
with self.assertRaises(ValidationError):
TestQueryUpdateModel.objects(partition=partition, cluster=3).update(count='asdf')
def test_update_with_no_values_failure(self):
""" tests calling update on models with no values passed in """
with self.assertRaises(ValidationError):
TestQueryUpdateModel.objects(partition=uuid4(), cluster=3).update()
def test_invalid_update_kwarg(self):
""" tests that passing in a kwarg to the update method that isn't a column will fail """
with self.assertRaises(ValidationError):