예제 #1
0
 def setUp(self):
     self.app = miami.app.test_client()
     miami.init_db()
     team = Team('Log')
     team.members.append(User('Mike'))
     create_entity(team)
     create_entity(Category('BUG'))
     when(miami.utils).now().thenReturn(datetime(2012, 11, 11, 1, 0, 0))
     self.login('Mike', '')
예제 #2
0
    def setUp(self):
        when(miami.utils).now().thenReturn(datetime(2012, 11, 5, 9, 0, 0))
        miami.init_db()
        team = Team('Log')
        team.members.append(User('yachuan.chen', email='*****@*****.**'))
        team.members.append(User('yue.zhang', email='*****@*****.**'))
        team.members.append(User('peng.yua', email='*****@*****.**'))
        db.session.add(team)
        db.session.add(Category('Feature'))
        db.session.add(Category('Bug'))
        db.session.add(Category('Test'))
        db.session.commit()

        task = Task('title1', 'detail', status='DONE', price=2, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=10), ready_time=miami.utils.get_last_monday().replace(hour=10))
        ts = TimeSlot(miami.utils.get_last_monday().replace(hour=10), 7200, User.query.get(1))
        task.time_slots.append(ts)
        task.categories.append(Category.query.get(1))
        db.session.add(task)
        db.session.commit()

        task = Task('title2', 'detail2', status='DONE', price=2, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=12), ready_time=miami.utils.get_last_monday().replace(hour=12))
        ts = TimeSlot(miami.utils.get_last_monday().replace(hour=12), 3600, User.query.get(1), partner=User.query.get(2))
        task.time_slots.append(ts)
        task.categories.append(Category.query.get(1))
        db.session.add(task)
        db.session.commit()

        ##unplanned
        task = Task('title3', 'detail3', status='DONE', price=2, estimate=4, team=Team.query.get(1), start_time=(miami.utils.get_last_monday() + timedelta(days=1)).replace(hour=14), ready_time=(miami.utils.get_last_monday() + timedelta(days=1)).replace(hour=14))
        ts = TimeSlot(miami.utils.get_last_monday().replace(hour=14), 3600, User.query.get(2), partner=User.query.get(1))
        task.time_slots.append(ts)
        task.categories.append(Category.query.get(2))
        db.session.add(task)
        db.session.commit()

        ###Ready###
        task = Task('title4', 'detail4', status='READY', price=2, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=14), ready_time=miami.utils.get_last_monday().replace(hour=14))
        ts = TimeSlot(miami.utils.get_last_monday().replace(hour=14), 3600, User.query.get(2), partner=User.query.get(1))
        task.time_slots.append(ts)
        task.categories.append(Category.query.get(1))
        db.session.add(task)
        db.session.commit()

        task = Task('title6', 'detail6', status='READY', price=1, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=10), ready_time=miami.utils.get_last_monday().replace(hour=10))
        db.session.add(task)
        task.categories.append(Category.query.get(3))
        db.session.commit()

        ###history###
        task = Task('title5', 'detail5', status='DONE', price=2, estimate=4, team=Team.query.get(1), start_time=(miami.utils.get_last_monday() - timedelta(days=5)).replace(hour=14), ready_time=(miami.utils.get_last_monday() - timedelta(days=5)).replace(hour=14))
        ts = TimeSlot((miami.utils.get_last_monday() - timedelta(days=5)).replace(hour=14), 3600, User.query.get(2))
        task.time_slots.append(ts)
        task.categories.append(Category.query.get(1))
        db.session.add(task)
        db.session.commit()
예제 #3
0
 def setUp(self):
     miami.init_db()
     team = Team('Log')
     team.members.append(User('Mike'))
     create_entity(team)
     when(miami.utils).now().thenReturn(datetime(2012, 11, 11, 23, 0, 0))
예제 #4
0
파일: init_db.py 프로젝트: archiechen/miami
#-*- coding:utf-8 -*-
import os
os.environ['MIAMI_ENV'] = 'dev'
import miami
from miami.models import User, Team, Task, TimeSlot, Burning,Category
from miami import db
from datetime import timedelta

miami.init_db()
team = Team('Log')
team.members.append(User('yachuan.chen', email='*****@*****.**'))
team.members.append(User('yue.zhang', email='*****@*****.**'))
team.members.append(User('peng.yuan', email='*****@*****.**'))
db.session.add(team)
db.session.add(Category(u'功能'))
db.session.add(Category('Bug'))
db.session.add(Category('Test'))
db.session.commit()

task = Task('title1', 'detail', status='DONE', price=1, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=10), ready_time=miami.utils.get_last_monday().replace(hour=10))
ts = TimeSlot(miami.utils.get_last_monday().replace(hour=10), 7200, User.query.get(1))
task.time_slots.append(ts)
task.categories.append(Category.query.get(1))
task.time_slots.append(TimeSlot(miami.utils.get_last_monday().replace(hour=14), 7200, User.query.get(1), partner=User.query.get(2)))
db.session.add(task)
db.session.commit()

task = Task('title2', 'detail2', status='DONE', price=2, estimate=4, team=Team.query.get(1), start_time=miami.utils.get_last_monday().replace(hour=12), ready_time=miami.utils.get_last_monday().replace(hour=12))
ts = TimeSlot(miami.utils.get_last_monday().replace(hour=12), 3600, User.query.get(1), partner=User.query.get(2))
task.time_slots.append(ts)
task.categories.append(Category.query.get(1))
예제 #5
0
 def setUp(self):
     miami.init_db()
     team = Team('Log')
     team.members.append(User('Mike'))
     create_entity(team)
     when(miami.utils).now().thenReturn(datetime(2012, 11, 11, 23, 0, 0))
예제 #6
0
 def setUp(self):
     self.app = miami.app.test_client()
     miami.init_db()
     self.create_entity(User('Mike'))
     self.login('Mike', '')
예제 #7
0
 def setUp(self):
     self.app = miami.app.test_client()
     miami.init_db()
     create_entity(User('Mike'))
예제 #8
0
 def setUp(self):
     self.app = miami.app.test_client()
     miami.init_db()
     create_entity(User("Mike"))
예제 #9
0
#-*- coding:utf-8 -*-
import os
os.environ['MIAMI_ENV'] = 'dev'
import miami
from miami.models import User, Team, Task, TimeSlot, Burning, Category
from miami import db
from datetime import timedelta

miami.init_db()
team = Team('Log')
team.members.append(User('yachuan.chen', email='*****@*****.**'))
team.members.append(User('yue.zhang', email='*****@*****.**'))
team.members.append(User('peng.yuan', email='*****@*****.**'))
db.session.add(team)
db.session.add(Category(u'功能'))
db.session.add(Category('Bug'))
db.session.add(Category('Test'))
db.session.commit()

task = Task('title1',
            'detail',
            status='DONE',
            price=1,
            estimate=4,
            team=Team.query.get(1),
            start_time=miami.utils.get_last_monday().replace(hour=10),
            ready_time=miami.utils.get_last_monday().replace(hour=10))
ts = TimeSlot(miami.utils.get_last_monday().replace(hour=10), 7200,
              User.query.get(1))
task.time_slots.append(ts)
task.categories.append(Category.query.get(1))