def METHOD_NAME(self, inventory, project, survey_spec_factory, cls):
    params = {}
    if cls == 'JobTemplate':
        params['inventory'] = inventory
        params['project'] = project
    # test basic decryption
    jt = getattr(models, cls).objects.create(
        name='Example Template',
        survey_spec=survey_spec_factory([{'variable': 'secret_key', 'default': encrypt_value('donttell', pk=None), 'type': 'password'}]),
        survey_enabled=True,
        **params
    )
    job = jt.create_unified_job()
    assert jt.survey_spec['spec'][0]['default'].startswith(PREFIX)
    assert job.survey_passwords == {'secret_key': '$encrypted$'}
    assert json.loads(job.decrypted_extra_vars())['secret_key'] == 'donttell'
    # re-key the extra_vars
    new_key = regenerate_secret_key.Command().handle()
    new_job = models.UnifiedJob.objects.get(pk=job.pk)
    assert new_job.extra_vars != job.extra_vars
    # verify that the old SECRET_KEY doesn't work
    with pytest.raises(InvalidToken):
        new_job.decrypted_extra_vars()
    # verify that the new SECRET_KEY *does* work
    with override_settings(SECRET_KEY=new_key):
        assert json.loads(new_job.decrypted_extra_vars())['secret_key'] == 'donttell'