Commit c715c8ec authored by ibuler's avatar ibuler

修改bug, 添加测试文件

parent a05e4147
......@@ -20,7 +20,7 @@ class Asset(models.Model):
password_common = models.CharField(max_length=160, blank=True, null=True)
username_super = models.CharField(max_length=80, blank=True, null=True)
password_super = models.CharField(max_length=160, blank=True, null=True)
date_added = models.CharField(max_length=80)
date_added = models.IntegerField(max_length=80)
comment = models.CharField(max_length=100, blank=True, null=True)
def __unicode__(self):
......
#coding: utf-8
import os
import django
os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
django.setup()
from juser.models import User, Group
from jasset.models import Asset, IDC
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,
ldap_pwd='hadoop', ssh_key_pwd='hadoop', date_joined=0)
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.save()
p = Permission(user=u, asset=a)
p.save()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment