Beispiel #1
0
def create_test_data():
    '''
    Creates test data to play with the server
    '''
    from django import setup
    setup()
    from control_chart.tests.utilies import create_grouped_users
    from control_chart.tests.utilies import create_sample_characteristic_values
    from control_chart.tests.utilies import create_correct_sample_data
    from control_chart.tests.utilies import create_plot_config

    create_grouped_users()
    create_correct_sample_data()
    create_sample_characteristic_values()
    create_plot_config()
Beispiel #2
0
def working_instance(request, live_server,
                     fix_webdriver,      # pylint: disable=W0621
                     transactional_db):  # pylint: disable=W0613
    """
    Create ready to use testing enviroment, with sample datas in the db and
    webdriver instance which is logged in as admin
    """
    def fin(selenium):
        """
        Close the Webdriver
        """
        selenium.quit()

    create_correct_sample_data()
    create_limited_users()
    create_sample_characteristic_values()
    selenium = fix_webdriver()
    selenium.get(live_server.url)
    login_as_admin(selenium)
    request.addfinalizer(lambda: fin(selenium))
    return selenium