def test_notify_repository(self): change = Change.objects.create(component=self.component, action=Change.ACTION_MERGE) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.anotheruser, "@Administration") notify_change(change.pk) # Check mail self.validate_notifications( 2, "[Weblate] Repository operation in Test/Test")
def test_notify_parse_error(self): change = Change.objects.create( translation=self.get_translation(), details={"error_message": "Failed merge", "filename": "test/file.po"}, action=Change.ACTION_PARSE_ERROR, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.anotheruser, "@Administration") notify_change(change.pk) # Check mail self.validate_notifications(3, "[Weblate] Parse error in Test/Test")
def test_notify_parse_error(self): change = Change.objects.create( translation=self.get_translation(), details={'error_message': 'Failed merge', 'filename': 'test/file.po'}, action=Change.ACTION_PARSE_ERROR, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.second_user(), '@Administration') notify_change(change.pk) # Check mail self.validate_notifications(3, '[Weblate] Parse error in Test/Test')
def test_notify_merge_failure(self): change = Change.objects.create( component=self.component, details={"error": "Failed merge", "status": "Error\nstatus"}, action=Change.ACTION_FAILED_MERGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.anotheruser, "@Administration") notify_change(change.pk) # Check mail self.validate_notifications(2, "[Weblate] Repository failure in Test/Test")
def test_notify_merge_failure(self): change = Change.objects.create( component=self.component, details={'error': 'Failed merge', 'status': 'Error\nstatus'}, action=Change.ACTION_FAILED_MERGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.second_user(), '@Administration') notify_change(change.pk) # Check mail self.validate_notifications(2, '[Weblate] Repository failure in Test/Test')
def test_notify_new_language(self): anotheruser = self.anotheruser change = Change.objects.create( user=anotheruser, component=self.component, details={"language": "de"}, action=Change.ACTION_REQUESTED_LANGUAGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(anotheruser, "@Administration") notify_change(change.pk) # Check mail self.validate_notifications(2, "[Weblate] New language request in Test/Test")
def test_notify_new_language(self): second_user = self.second_user() change = Change.objects.create( user=second_user, component=self.component, details={'language': 'de'}, action=Change.ACTION_REQUESTED_LANGUAGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(second_user, '@Administration') notify_change(change.pk) # Check mail self.validate_notifications(2, '[Weblate] New language request in Test/Test')
def test_notify_parse_error(self): change = Change.objects.create( translation=self.get_translation(), details={ 'error': 'Failed merge', 'filename': 'test/file.po', }, action=Change.ACTION_PARSE_ERROR, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.second_user(), '@Administration') notify_change(change.pk) # Check mail self.validate_notifications(3, '[Weblate] Parse error in Test/Test')
def test_notify_merge_failure(self): change = Change.objects.create( component=self.component, details={ 'error': 'Failed merge', 'status': 'Error\nstatus', }, action=Change.ACTION_FAILED_MERGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(self.second_user(), '@Administration') notify_change(change.pk) # Check mail self.validate_notifications(3, '[Weblate] Merge failure in Test/Test')
def test_notify_new_language(self): second_user = self.second_user() change = Change.objects.create( user=second_user, component=self.component, details={'language': 'de'}, action=Change.ACTION_REQUESTED_LANGUAGE, ) # Check mail self.assertEqual(len(mail.outbox), 1) # Add project owner self.component.project.add_user(second_user, '@Administration') notify_change(change.pk) # Check mail self.validate_notifications( 2, '[Weblate] New language request in Test/Test' )