
import os
import sys

from paste.deploy import appconfig

from openspending import mongo
from helpers import clean_all

__all__ = ['TestCase', 'DatabaseTestCase']

here_dir = os.getcwd()
config = appconfig('config:test.ini', relative_to=here_dir)
mongo.configure(config)

class TestCase(object):
    def setup(self):
        pass

    def teardown(self):
        pass

class DatabaseTestCase(TestCase):
    def teardown(self):
        clean_all()
        super(DatabaseTestCase, self).teardown()

import os
import sys

from pylons import config

from openspending import mongo
from .helpers import clean_all

__all__ = ['TestCase', 'DatabaseTestCase']

mongo.configure(config)

class TestCase(object):
    def setup(self):
        pass

    def teardown(self):
        pass

class DatabaseTestCase(TestCase):
    def teardown(self):
        clean_all()
        super(DatabaseTestCase, self).teardown()
Use config given on command line
Use config given on command line

  
  import os
  import sys
  
- from paste.deploy import appconfig
+ from pylons import config
  
  from openspending import mongo
- from helpers import clean_all
+ from .helpers import clean_all
  
  __all__ = ['TestCase', 'DatabaseTestCase']
  
- here_dir = os.getcwd()
- config = appconfig('config:test.ini', relative_to=here_dir)
  mongo.configure(config)
  
  class TestCase(object):
      def setup(self):
          pass
  
      def teardown(self):
          pass
  
  class DatabaseTestCase(TestCase):
      def teardown(self):
          clean_all()
          super(DatabaseTestCase, self).teardown()
Use config given on command line
## Code Before:

import os
import sys

from paste.deploy import appconfig

from openspending import mongo
from helpers import clean_all

__all__ = ['TestCase', 'DatabaseTestCase']

here_dir = os.getcwd()
config = appconfig('config:test.ini', relative_to=here_dir)
mongo.configure(config)

class TestCase(object):
    def setup(self):
        pass

    def teardown(self):
        pass

class DatabaseTestCase(TestCase):
    def teardown(self):
        clean_all()
        super(DatabaseTestCase, self).teardown()
## Instruction:
Use config given on command line
## Code After:

import os
import sys

from pylons import config

from openspending import mongo
from .helpers import clean_all

__all__ = ['TestCase', 'DatabaseTestCase']

mongo.configure(config)

class TestCase(object):
    def setup(self):
        pass

    def teardown(self):
        pass

class DatabaseTestCase(TestCase):
    def teardown(self):
        clean_all()
        super(DatabaseTestCase, self).teardown()