From 5426116ed4230d0c85cc2c7ea07e1f26a6fa96e7 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Dec 2014 22:48:43 +0800 Subject: [PATCH] add a test file. --- test_add_user.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test_add_user.py b/test_add_user.py index e24208450..0b3f2bcc9 100644 --- a/test_add_user.py +++ b/test_add_user.py @@ -12,14 +12,18 @@ from jpermission.models import Permission g = Group(name='wzp', comment='wzp project') g.save() -u = User(username='hadoop', password='hadoop', name='hadoop', email='ibuler@qq.com', group=g, +u = User(username='hadoop', password='hadoop', name='hadoop', email='ibuler@qq.com', ldap_pwd='hadoop', ssh_key_pwd='hadoop', date_joined=0) u.save() +u.group=[g] +u.save() i = IDC(name='lf') i.save() -a = Asset(ip='172.16.1.122', port=2001, idc=i, group=g, date_added=0) +a = Asset(ip='172.16.1.122', port=2001, idc=i, date_added=0) +a.save() +a.group = [g] a.save() p = Permission(user=u, asset=a)