From 607a29c44721a799b562de30c50846d633a32933 Mon Sep 17 00:00:00 2001 From: jlaine Date: Tue, 1 Jun 2010 12:37:45 +0000 Subject: [PATCH] add test cases for qs.values(*fields) and qs.values_list(*fields) git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@915 e071eeec-0327-468d-9b6a-08194a12b294 --- examples/tests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/tests.py b/examples/tests.py index f99ea2e..d41d576 100644 --- a/examples/tests.py +++ b/examples/tests.py @@ -169,6 +169,20 @@ class GroupTestCase(BaseTestCase): g.save() self.assertEquals(g.dn, 'cn=foogroup2,ou=groups,dc=nodomain') + def test_values(self): + qs = LdapGroup.objects.values('name') + self.assertEquals(len(qs), 3) + self.assertEquals(qs[0], {'name': 'foogroup'}) + self.assertEquals(qs[1], {'name': 'bargroup'}) + self.assertEquals(qs[2], {'name': 'wizgroup'}) + + def test_values_list(self): + qs = LdapGroup.objects.values_list('name') + self.assertEquals(len(qs), 3) + self.assertEquals(qs[0], ('foogroup',)) + self.assertEquals(qs[1], ('bargroup',)) + self.assertEquals(qs[2], ('wizgroup',)) + def test_delete(self): g = LdapGroup.objects.get(name='foogroup') g.delete() -- 2.30.2