|
1 | 1 | from unittest.mock import Mock, patch
|
2 | 2 |
|
| 3 | +from django.conf import settings |
3 | 4 | from django.test import Client, TestCase
|
4 | 5 | from django.test.utils import override_settings
|
5 | 6 |
|
@@ -87,32 +88,33 @@ def test_smoke(self):
|
87 | 88 |
|
88 | 89 | # API test
|
89 | 90 | r = su_client.get(
|
90 |
| - "/api/pofile/test/fr/djangojs/", headers={"x-cli-version": "0.0.3"} |
| 91 | + "/api/pofile/test/fr/djangojs/", |
| 92 | + headers={"x-cli-version": settings.CLI_VERSION}, |
91 | 93 | )
|
92 | 94 | self.assertEqual(r.status_code, 403)
|
93 | 95 |
|
94 | 96 | r = su_client.get(
|
95 | 97 | "/api/pofile/test/fr/djangojs/",
|
96 |
| - headers={"x-token": superuser.token, "x-cli-version": "0.0.3"}, |
| 98 | + headers={"x-token": superuser.token, "x-cli-version": settings.CLI_VERSION}, |
97 | 99 | )
|
98 | 100 | self.assertEqual(r.status_code, 200)
|
99 | 101 | self.assertEqual(r.content.decode("utf-8"), c.pofile)
|
100 | 102 |
|
101 | 103 | r = su_client.patch(
|
102 | 104 | "/api/pofile/test/fr/djangojs/",
|
103 |
| - headers={"x-token": superuser.token, "x-cli-version": "0.0.3"}, |
| 105 | + headers={"x-token": superuser.token, "x-cli-version": settings.CLI_VERSION}, |
104 | 106 | )
|
105 | 107 | self.assertEqual(r.status_code, 405)
|
106 | 108 |
|
107 | 109 | r = su_client.get(
|
108 | 110 | "/api/pofile/test/de/djangojs/",
|
109 |
| - headers={"x-token": superuser.token, "x-cli-version": "0.0.3"}, |
| 111 | + headers={"x-token": superuser.token, "x-cli-version": settings.CLI_VERSION}, |
110 | 112 | )
|
111 | 113 | self.assertEqual(r.status_code, 404)
|
112 | 114 |
|
113 | 115 | r = su_client.post(
|
114 | 116 | "/api/pofile/test/fr/djangojs/",
|
115 |
| - headers={"x-token": superuser.token, "x-cli-version": "0.0.3"}, |
| 117 | + headers={"x-token": superuser.token, "x-cli-version": settings.CLI_VERSION}, |
116 | 118 | data=b"""\
|
117 | 119 | #: conf/strings.js frontend/intro/intro.js frontend/people/person.js
|
118 | 120 | msgid "Continue"
|
@@ -149,7 +151,7 @@ def test_smoke(self):
|
149 | 151 | # Different language!
|
150 | 152 | r = su_client.put(
|
151 | 153 | "/api/pofile/test/de/djangojs/",
|
152 |
| - headers={"x-token": superuser.token, "x-cli-version": "0.0.3"}, |
| 154 | + headers={"x-token": superuser.token, "x-cli-version": settings.CLI_VERSION}, |
153 | 155 | data=b"""\
|
154 | 156 | #: conf/strings.js frontend/intro/intro.js frontend/people/person.js
|
155 | 157 | msgid "Continue"
|
|
0 commit comments