title: Django and APScheduler on the same Postgres failed to run test
body: <p>In my project code. I have <code>Django 1.11</code> and <code>APScheduler 3.3.1</code> running with <code>Postgres 9.6</code></p>
  
  <p>The problem is during the full testcaes. <code>APScheduler</code> hits database <code>Postgres</code> before Django finish the migrations.<br></p>
  
  <p>On my OSX Laptop does not has that problem.</p>
  
  <p>Is there any technique I can avoid this problem?</p>
  
  <h2>Update</h2>
  
  <p><code>models.py</code></p>
  
  <pre><code>from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
  from apscheduler.schedulers.background import BackgroundScheduler
  
  schd_inst = BackgroundScheduler(jobstores={
      'default': SQLAlchemyJobStore(
          url=settings.DATABASE_URL,
          tablename='apscheduler_jobs'
      )
  })
  
  try:
       schd_inst.start()
   except SchedulerAlreadyRunningError:
       logger.info(str(SchedulerAlreadyRunningError))
  
  class MailAPIScheduler(DirtyFieldsMixin, AbstractSoftModelController):
      dealer = models.ForeignKey(Dealer, on_delete=models.CASCADE)
      api_url = models.URLField()
      schedule_time = JSONField(default={'hour': 0, 'minute': 0})  # 24hr e.g. {'hour': 13, 'minute': 3}
      parameters = JSONField()  # {'key': 'api-key', 'value': '123'}
      summary_email_receivers = ArrayField(
          models.EmailField(blank=True),
          blank=True
      )
      schd_id = models.UUIDField(default=uuid.uuid4, unique=True)  # uuid gen at python code not database level
  </code></pre>
  
  <p><code>settings.py</code></p>
  
  <pre><code>LOCAL_APPS = [
      ...,
      'myapp',
      ...
  ]
  </code></pre>
  
  <p><strong>Error:</strong> <br></p>
  
  <pre><code>python manage.py test
  Scheduler DB: postgres://postgres:qwerty@postgres:5432/eneos_pos
  Hey, I'm Local!
  Scheduler DB: postgres://postgres:qwerty@postgres:5432/eneos_pos
  Traceback (most recent call last):
  ...
  psycopg2.OperationalError: FATAL:  database "eneos_pos" does not exist
  The above exception was the direct cause of the following exception:
  Traceback (most recent call last):
  ...
  File "/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
      conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
  sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  database "eneos_pos" does not exist
  FAILEDBuild failed !!!.
  </code></pre>