'Run the test for each possible rerandomize value'

@ddt.data('false', 'true', RANDOMIZATION.NEVER, RANDOMIZATION.PER_STUDENT, RANDOMIZATION.ALWAYS, RANDOMIZATION.ONRESET)
def test_random_seed_with_reset(self, rerandomize):

    def _reset_and_get_seed(module):
        "\n                                                Reset    the    XModule    and    return    the    module's    seed\n                                                "
        module.done = True
        module.reset_problem({})
        return module.seed
    def _retry_and_check(num_tries, test_func):
        '\n                                                Returns    True    if    *test_func*    was    successful\n                                                (returned    True)    within    *num_tries*    attempts\n\n                                                *test_func*    must    be    a    function\n                                                of    the    form    test_func()    ->    bool\n                                                '
        success = False
        for __ in range(num_tries):
            if (test_func() is True):
                success = True
                break
        return success
    module = CapaFactory.create(rerandomize=rerandomize, done=True)
    seed = module.seed
    self.assertIsNotNone(seed)
    if (rerandomize in [RANDOMIZATION.NEVER, 'false', RANDOMIZATION.PER_STUDENT]):
        self.assertEqual(seed, _reset_and_get_seed(module))
    else:
        success = _retry_and_check(10, (lambda : (_reset_and_get_seed(module) != seed)))
        self.assertIsNotNone(module.seed)
        msg = 'Could    not    get    a    new    seed    from    reset    after    10    tries'
        self.assertTrue(success, msg)
