本文整理汇总了Python中examples.models.LdapGroup.usernames方法的典型用法代码示例。如果您正苦于以下问题:Python LdapGroup.usernames方法的具体用法?Python LdapGroup.usernames怎么用?Python LdapGroup.usernames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类examples.models.LdapGroup
的用法示例。
在下文中一共展示了LdapGroup.usernames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save
# 需要导入模块: from examples.models import LdapGroup [as 别名]
# 或者: from examples.models.LdapGroup import usernames [as 别名]
def test_save(self):
g = LdapGroup()
g.name = 'newgroup'
g.gid = 1010
g.usernames = ['someuser', 'foouser']
g.save()
new = LdapGroup.objects.get(name='newgroup')
self.assertEquals(new.name, 'newgroup')
self.assertEquals(new.gid, 1010)
self.assertEquals(new.usernames, ['someuser', 'foouser'])
示例2: setUp
# 需要导入模块: from examples.models import LdapGroup [as 别名]
# 或者: from examples.models.LdapGroup import usernames [as 别名]
def setUp(self):
super(GroupTestCase, self).setUp()
g = LdapGroup()
g.name = "foogroup"
g.gid = 1000
g.usernames = ['foouser', 'baruser']
g.save()
g = LdapGroup()
g.name = "bargroup"
g.gid = 1001
g.usernames = ['zoouser', 'baruser']
g.save()
g = LdapGroup()
g.name = "wizgroup"
g.gid = 1002
g.usernames = ['wizuser', 'baruser']
g.save()
示例3: test_insert
# 需要导入模块: from examples.models import LdapGroup [as 别名]
# 或者: from examples.models.LdapGroup import usernames [as 别名]
def test_insert(self):
g = LdapGroup()
g.name = 'newgroup'
g.gid = 1010
g.usernames = ['someuser', 'foouser']
g.save()
# check group was created
new = LdapGroup.objects.get(name='newgroup')
self.assertEqual(new.name, 'newgroup')
self.assertEqual(new.gid, 1010)
self.assertCountEqual(new.usernames, ['someuser', 'foouser'])
示例4: test_insert
# 需要导入模块: from examples.models import LdapGroup [as 别名]
# 或者: from examples.models.LdapGroup import usernames [as 别名]
def test_insert(self):
g = LdapGroup()
g.name = "newgroup"
g.gid = 1010
g.usernames = ["someuser", "foouser"]
g.save()
self.assertEquals(self.ldapobj.methods_called(), ["initialize", "simple_bind_s", "add_s"])
# check group was created
new = LdapGroup.objects.get(name="newgroup")
self.assertEquals(new.name, "newgroup")
self.assertEquals(new.gid, 1010)
self.assertEquals(new.usernames, ["someuser", "foouser"])
示例5: test_insert
# 需要导入模块: from examples.models import LdapGroup [as 别名]
# 或者: from examples.models.LdapGroup import usernames [as 别名]
def test_insert(self):
g = LdapGroup()
g.name = 'newgroup'
g.gid = 1010
g.usernames = ['someuser', 'foouser']
g.save()
self.assertEquals(self.ldapobj.methods_called(), [
'initialize',
'simple_bind_s',
'add_s'])
# check group was created
new = LdapGroup.objects.get(name='newgroup')
self.assertEquals(new.name, 'newgroup')
self.assertEquals(new.gid, 1010)
self.assertEquals(new.usernames, ['someuser', 'foouser'])