Example #1
0
def run_seed():
    confirm_write_access()

    if not current_app.app_config.feature.seed_allowed:
        raise BadRequest("seed not allowed in this environment")

    seed(db, current_app.app_config, skip_seed=False, perf_test=True)

    return {}, 201
Example #2
0
def clean_slate():
    confirm_write_access()

    if not current_app.app_config.feature.seed_allowed:
        raise BadRequest("clean_slate not allowed in this environment")

    seed(db, current_app.app_config, skip_seed=True)

    return {}, 201
Example #3
0
 def setUp(self):
     db = self.app.db
     with self.app.app_context():
         seed(db)
Example #4
0
 def setUp(self):
     mongo_db = self.app.mongo
     with self.app.app_context():
         seed(mongo_db)
Example #5
0
#!/usr/bin/env python3

# This script import the test seed data into an existing SBS instance/database
# Useful for deploying test instances

import sys
import os

os.environ["CONFIG"] = "config/config.yml"
sys.path.insert(0, "/opt/sbs/sbs")

from server.test.seed import seed  # noQA:E402
from server.__main__ import app    # noQA:E402

db = app.db
with app.app_context():
    seed(db, app.app_config)

sys.exit()
Example #6
0
 def setUp(self):
     db = self.app.db
     with self.app.app_context():
         os.environ["SEEDING"] = "1"
         seed(db, self.app.app_config)
         del os.environ["SEEDING"]