Test for delete translations with different parent
@@ -231,7 +231,7 @@ class TestProject(TestCase):
self.assertIn(project_b, project_a.translations.all())
# User B tries to delete translation from user A
- # with its project
+ # with a different parent
self.client.login(username=user_b.username, password='test')
self.assertIn(project_b, project_a.translations.all())
resp = self.client.post(
@@ -244,6 +244,20 @@ class TestProject(TestCase):
self.assertEqual(resp.status_code, 404)
self.assertIn(project_b, project_a.translations.all())
+ # User A tries to delete translation from user A
+ # with a different parent
+ self.client.login(username=user_a.username, password='test')
+ self.assertIn(project_b, project_a.translations.all())
+ resp = self.client.post(
+ reverse(
+ 'projects_translations_delete',
+ args=[project_b.slug, project_b.slug]
+ ),
+ follow=True
+ )
+ self.assertEqual(resp.status_code, 404)
+ self.assertIn(project_b, project_a.translations.all())
+
def test_token(self):
r = self.client.get('/api/v2/project/6/token/', {})
resp = json.loads(r.content)
