

def test_valid_user(self):
    user = factories.UserFactory()
    script_version = self.translate_script
    script = script_version.script
    d = utils.valid_user(script, user)
    self.assertTrue(d['valid'])
    from .. import settings as wooey_settings
    self.assertEqual('disabled', d['display'])
    wooey_settings.WOOEY_SHOW_LOCKED_SCRIPTS = False
    d = utils.valid_user(script, user)
    self.assertEqual('hide', d['display'])
    from django.contrib.auth.models import Group
    test_group = Group(name='test')
    test_group.save()
    script.user_groups.add(test_group)
    d = utils.valid_user(script, user)
    self.assertFalse(d['valid'])
    user.groups.add(test_group)
    d = utils.valid_user(script, user)
    self.assertTrue(d['valid'])

dataset/ETHPy150Open wooey/Wooey/wooey/tests/test_utils.py TestUtils.test_valid_user/original