def _post_teardown(self): # Call the original method. super(test.TestCase, self)._post_teardown() Award.objects.all().delete() Badge.objects.all().delete() loading.cache.loaded = False if get_url_prefix: # If we're in funfactoryland, back out of the locale tweaks set_url_prefix(self.old_prefix)
def _pre_setup(self): loading.cache.loaded = False call_command('update_badges', verbosity=0) badger.autodiscover() if get_url_prefix: # If we're in funfactoryland, make sure a locale prefix is # set for urlresolvers locale = 'en-US' self.old_prefix = get_url_prefix() self.old_locale = get_language() rf = RequestFactory() set_url_prefix(Prefixer(rf.get('/%s/' % (locale, )))) # Create a default user for tests self.user_1 = self._get_user(username="******", email="*****@*****.**", password="******") # Call the original method that does the fixtures etc. super(test.TestCase, self)._pre_setup()
def _pre_setup(self): loading.cache.loaded = False call_command('update_badges', verbosity=0) badger.autodiscover() if get_url_prefix: # If we're in funfactoryland, make sure a locale prefix is # set for urlresolvers locale = 'en-US' self.old_prefix = get_url_prefix() self.old_locale = get_language() rf = RequestFactory() set_url_prefix(Prefixer(rf.get('/%s/' % (locale,)))) # Create a default user for tests self.user_1 = self._get_user(username="******", email="*****@*****.**", password="******") # Call the original method that does the fixtures etc. super(test.TestCase, self)._pre_setup()