def test_load_reads_username_from_db(self):
    self.ctx.username = 'foobar'
    self.stack = stack.Stack(self.ctx, 'stack_name', self.tmpl)
    self.stack.store()
    stack_id = self.stack.id
    self.ctx.username = None
    stk = stack.Stack.load(self.ctx, stack_id=stack_id)
    self.assertEqual('foobar', stk.username)
    self.ctx.username = 'not foobar'
    stk = stack.Stack.load(self.ctx, stack_id=stack_id)
    self.assertEqual('foobar', stk.username)
def test_load_reads_username_from_db(self):
    self.ctx.username = 'foobar'
    self.stack = stack.Stack(self.ctx, 'stack_name', self.tmpl)
    self.stack.store()
    stack_id = self.stack.id
    self.ctx.username = None
    stk = stack.Stack.load(self.ctx, stack_id=stack_id)
    self.assertEqual('foobar', stk.username)
    self.ctx.username = 'not foobar'
    stk = stack.Stack.load(self.ctx, stack_id=stack_id)
    self.assertEqual('foobar', stk.username)