Browse Source

Tweak help message in initdev

Rafał Pitoń 7 years ago
parent
commit
521be802ce
2 changed files with 9 additions and 5 deletions
  1. 2 2
      initdev
  2. 7 3
      misago/threads/tests/test_thread_reply_api.py

+ 2 - 2
initdev

@@ -38,7 +38,7 @@ DEFAULT='\033[0m'
 echo ""
 echo ""
 echo "================================================================================"
 echo "================================================================================"
 echo ""
 echo ""
-echo "Note: running 'initdev' after already having used it previously to setup Misago"
+echo "Note: running 'initdev' after already having used it to setup Misago"
 echo "for development may result in any of following errors occuring:"
 echo "for development may result in any of following errors occuring:"
 echo ""
 echo ""
 echo "  - CommandError: /srv/misago/... already exists, overlaying a project or app into an existing directory won't replace conflicting files"
 echo "  - CommandError: /srv/misago/... already exists, overlaying a project or app into an existing directory won't replace conflicting files"
@@ -47,7 +47,7 @@ echo "  - django.core.exceptions.ImproperlyConfigured: settings.DATABASES is imp
 echo "  - python: can't open file 'manage.py': [Errno 2] No such file or directory"
 echo "  - python: can't open file 'manage.py': [Errno 2] No such file or directory"
 echo ""
 echo ""
 echo "If you are experiencing either of those errors, this means that files are"
 echo "If you are experiencing either of those errors, this means that files are"
-echo "present in the repository\'s main directory preventing 'initdev' from succedding."
+echo "present in the repository's main directory preventing 'initdev' from succedding."
 echo "Please try running the 'initdev' with \"--f\" option to force old files deletion:"
 echo "Please try running the 'initdev' with \"--f\" option to force old files deletion:"
 echo ""
 echo ""
 echo "  docker-compose run --rm misago initdev --f"
 echo "  docker-compose run --rm misago initdev --f"

+ 7 - 3
misago/threads/tests/test_thread_reply_api.py

@@ -43,6 +43,9 @@ class ReplyThreadTests(AuthenticatedUserTestCase):
 
 
         response = self.client.post(self.api_link)
         response = self.client.post(self.api_link)
         self.assertEqual(response.status_code, 403)
         self.assertEqual(response.status_code, 403)
+        self.assertEqual(response.json(), {
+            'detail': "You can't reply to threads in this category.",
+        })
 
 
     def test_thread_visibility(self):
     def test_thread_visibility(self):
         """thread's visibility is validated"""
         """thread's visibility is validated"""
@@ -63,9 +66,10 @@ class ReplyThreadTests(AuthenticatedUserTestCase):
         self.override_acl({'can_reply_threads': 0})
         self.override_acl({'can_reply_threads': 0})
 
 
         response = self.client.post(self.api_link)
         response = self.client.post(self.api_link)
-        self.assertContains(
-            response, "You can't reply to threads in this category.", status_code=403
-        )
+        self.assertEqual(response.status_code, 403)
+        self.assertEqual(response.json(), {
+            'detail': "You can't reply to threads in this category.",
+        })
 
 
     def test_closed_category(self):
     def test_closed_category(self):
         """permssion to reply in closed category is validated"""
         """permssion to reply in closed category is validated"""