Commits

John Kalantzis  committed f53118f

lotte: Fix remaining test cases.

  • Participants
  • Parent commits 6d85fce

Comments (0)

Files changed (2)

File transifex/addons/lotte/tests/permissions.py

             self.project.slug, self.language.code])
         # GET
         resp = self.client['registered'].get(page_url, follow=True)
-        self.assertEqual(resp.status_code, 403)
+        self.assertEqual(resp.status_code, 405)
         # POST
         resp = self.client['registered'].post(page_url, follow=True)
         self.assertEqual(resp.status_code, 403)
             self.project.slug, self.language.code])
         # GET
         resp = self.client['team_member'].get(page_url, follow=True)
-        self.assertEqual(resp.status_code, 200)
+        self.assertEqual(resp.status_code, 405)
         # POST
-        resp = self.client['team_member'].post(page_url, follow=True)
+        resp = self.client['team_member'].post(page_url, '{"updated": "updated"}',
+            content_type='application/json', follow=True)
         self.assertEqual(resp.status_code, 200)
 
         # Test delete translation
             self.project.slug, self.language.code])
         # GET
         resp = self.client['maintainer'].get(page_url, follow=True)
-        self.assertEqual(resp.status_code, 200)
+        self.assertEqual(resp.status_code, 405)
         # POST
-        resp = self.client['maintainer'].post(page_url, follow=True)
+        resp = self.client['maintainer'].post(page_url, '{"updated": "updated"}',
+            content_type='application/json', follow=True)
         self.assertEqual(resp.status_code, 200)
 
         # Test delete translation

File transifex/addons/lotte/views.py

     Exiting Lotte
     """
 
+    if request.method != 'POST':
+        return HttpResponse(status=405)
+
     # Permissions handling
     # Project should always be available
     project = get_object_or_404(Project, slug=project_slug)