def assert_registration(self, match=None, reset=False): if match is None and reset: match = "[Weblate] Password reset on Weblate" url = self.assert_registration_mailbox(match) if self.clear_cookie and "sessionid" in self.client.cookies: del self.client.cookies["sessionid"] # Verify that cleanup does not break the workflow if self.social_cleanup: cleanup_social_auth() # Confirm account response = self.client.get(url, follow=True) if reset: # Ensure we can set the password self.assertRedirects(response, reverse("password_reset")) self.assertContains(response, "You can now set new one") # Invalid submission response = self.client.post(reverse("password_reset")) self.assertContains(response, "You can now set new one") # Set password response = self.client.post( reverse("password_reset"), {"new_password1": "2pa$$word!", "new_password2": "2pa$$word!"}, follow=True, ) self.assertContains(response, "Your password has been changed") else: self.assertRedirects(response, reverse("password")) return url
def handle(self, *args, **options): """Perfom cleanup of Weblate database.""" cleanup_fulltext() cleanup_screenshot_files() with transaction.atomic(): cleanup_social_auth() for project in Project.objects.values_list('id', flat=True): cleanup_project(project) cleanup_suggestions()
def handle(self, *args, **options): """Perfom cleanup of Weblate database.""" cleanup_fulltext() cleanup_screenshot_files() with transaction.atomic(): cleanup_social_auth() for project in Project.objects.values_list('id', flat=True): cleanup_project(project) cleanup_suggestions() cleanup_stale_repos() cleanup_old_suggestions()
def handle(self, *args, **options): """Perfom cleanup of Weblate database.""" cleanup_screenshot_files() with transaction.atomic(): cleanup_social_auth() for project in Project.objects.values_list("id", flat=True): cleanup_project(project) cleanup_suggestions() cleanup_stale_repos() cleanup_old_suggestions() cleanup_old_comments()
def test_cleanup_social_auth(self): cleanup_social_auth()