<commit_before>#!/bin/bash
set -e

# Cleanup and initialize
rm -rf test_project
rm -rf output
mkdir output
dropdb -Upostgres test_project --if-exists
createdb -Upostgres test_project
psql -Upostgres test_project -c "CREATE EXTENSION postgis";

MANAGE="test_project/db/manage.py --settings test_project.settings.prod"

# wq start: Create new project and verify empty config
rm -rf test_project
wq start test_project -d test.wq.io
sed -i "s/'USER': 'test_project'/'USER': 'postgres'/" test_project/db/test_project/settings/prod.py
sed -i "s/ALLOWED_HOSTS/# ALLOWED_HOSTS/" test_project/db/test_project/settings/prod.py
$MANAGE migrate
$MANAGE dump_config > output/config1.json
./json-compare.py expected/config1.json output/config1.json
<commit_msg>use env variable<commit_after>#!/bin/bash
set -e

# Cleanup and initialize
rm -rf test_project
rm -rf output
mkdir output
dropdb -Upostgres test_project --if-exists
createdb -Upostgres test_project
psql -Upostgres test_project -c "CREATE EXTENSION postgis";

export DJANGO_SETTINGS_MODULE="test_project.settings.prod"

MANAGE="test_project/db/manage.py"

# wq start: Create new project and verify empty config
rm -rf test_project
wq start test_project -d test.wq.io
sed -i "s/'USER': 'test_project'/'USER': 'postgres'/" test_project/db/test_project/settings/prod.py
sed -i "s/ALLOWED_HOSTS/# ALLOWED_HOSTS/" test_project/db/test_project/settings/prod.py
$MANAGE migrate
$MANAGE dump_config > output/config1.json
./json-compare.py expected/config1.json output/config1.json

{'fraction_non_alphanumeric': 0.10994075049374588, 'fraction_numerical': 0.003949967083607637, 'mean_word_length': 5.08, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3669900', 'n_tokens_mistral': 534, 'n_tokens_neox': 534, 'n_words': 136}