
from openstack.common import context
from openstack.common import test


class ContextTest(test.BaseTestCase):

    def test_context(self):
        ctx = context.RequestContext()
        self.assertTrue(ctx)

    def test_admin_context_show_deleted_flag_default(self):
        ctx = context.get_admin_context()
        self.assertFalse(ctx.show_deleted)


from oslotest import base as test_base

from openstack.common import context


class ContextTest(test_base.BaseTestCase):

    def test_context(self):
        ctx = context.RequestContext()
        self.assertTrue(ctx)

    def test_admin_context_show_deleted_flag_default(self):
        ctx = context.get_admin_context()
        self.assertFalse(ctx.show_deleted)

Use oslotest instead of common test module
Use oslotest instead of common test module

Module openstack.common.test is obsolete, so we should use
oslotest library instead of it.
Modified tests and common database code, new requirement added.

Change-Id: I853e548f11a4c3785eaf75124510a6d789536634

+ 
+ from oslotest import base as test_base
  
  from openstack.common import context
- from openstack.common import test
  
  
- class ContextTest(test.BaseTestCase):
+ class ContextTest(test_base.BaseTestCase):
  
      def test_context(self):
          ctx = context.RequestContext()
          self.assertTrue(ctx)
  
      def test_admin_context_show_deleted_flag_default(self):
          ctx = context.get_admin_context()
          self.assertFalse(ctx.show_deleted)
  
Use oslotest instead of common test module
## Code Before:

from openstack.common import context
from openstack.common import test


class ContextTest(test.BaseTestCase):

    def test_context(self):
        ctx = context.RequestContext()
        self.assertTrue(ctx)

    def test_admin_context_show_deleted_flag_default(self):
        ctx = context.get_admin_context()
        self.assertFalse(ctx.show_deleted)

## Instruction:
Use oslotest instead of common test module
## Code After:

from oslotest import base as test_base

from openstack.common import context


class ContextTest(test_base.BaseTestCase):

    def test_context(self):
        ctx = context.RequestContext()
        self.assertTrue(ctx)

    def test_admin_context_show_deleted_flag_default(self):
        ctx = context.get_admin_context()
        self.assertFalse(ctx.show_deleted)
