mirror of https://github.com/jumpserver/jumpserver
修改bug, 添加测试文件
parent
a05e4147a3
commit
c715c8ec02
|
@ -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):
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#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()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue