Updated with_id to raise Error if used with a filter.

Closes #365
This commit is contained in:
Ross Lawley
2011-12-02 07:11:06 -08:00
parent a6948771d8
commit e9d7353294
4 changed files with 11 additions and 1 deletions

View File

@@ -154,6 +154,8 @@ class QuerySetTest(unittest.TestCase):
person = self.Person.objects.with_id(person1.id)
self.assertEqual(person.name, "User A")
self.assertRaises(InvalidQueryError, self.Person.objects(name="User A").with_id, person1.id)
def test_find_only_one(self):
"""Ensure that a query using ``get`` returns at most one result.
"""