diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-21 18:23:34 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-21 18:23:34 +0000 |
| commit | bf071f7c0cbd6e0eaccc404be9e73493dddeba50 (patch) | |
| tree | 346af4932cd84835a597ef425c30bc1cae259bcb /tests | |
| parent | 706b18966f7f6dcef715ca7b5230e72147cefda6 (diff) | |
[soc2010/query-refactor] Clean up the implementation of lookup_type, added more tests, and killed code that wasn't tested.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13369 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/mongodb/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/mongodb/tests.py b/tests/regressiontests/mongodb/tests.py index 831752e052..95560755b6 100644 --- a/tests/regressiontests/mongodb/tests.py +++ b/tests/regressiontests/mongodb/tests.py @@ -58,13 +58,20 @@ class MongoTestCase(TestCase): self.assertFalse(hasattr(b, "_current_group_cache")) self.assertEqual(b.current_group, e) + def test_exists(self): + self.assertFalse(Artist.objects.filter(name="Brian May").exists()) + Artist.objects.create(name="Brian May") + self.assertTrue(Artist.objects.filter(name="Brian May").exists()) + def test_not_equals(self): q = Group.objects.create(name="Queen", year_formed=1971) e = Group.objects.create(name="The E Street Band", year_formed=1972) + b = Group.objects.create(name="The Beetles") self.assertQuerysetEqual( Group.objects.exclude(year_formed=1972), [ "Queen", + "The Beetles", ], lambda g: g.name, ) |
