<commit_before>from django.contrib.auth.models import User
from django.db.models.signals import post_migrate


def test_user(sender, *args, **kwargs):
    user, c = User.objects.get_or_create(username='test')
    user.is_staff = True
    user.is_superuser = True
    user.set_password('<PASSWORD>')
    user.save()

post_migrate.connect(test_user)<commit_msg>No need to install test user on every app's migration<commit_after>from django.contrib.auth.models import User
from django.db.models.signals import post_migrate


def test_user(sender, *args, **kwargs):
    if sender.name != 'django.contrib.auth':
        return

    user, c = User.objects.get_or_create(username='test')
    user.is_staff = True
    user.is_superuser = True
    user.set_password('<PASSWORD>')
    user.save()

post_migrate.connect(test_user)
{'fraction_non_alphanumeric': 0.115995115995116, 'fraction_numerical': 0.0, 'mean_word_length': 4.430463576158941, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6932837', 'n_tokens_mistral': 268, 'n_tokens_neox': 266, 'n_words': 56}