Skip to content

Commit 0e3aa59

Browse files
committed
Test for escaped variables
1 parent 8f17b5c commit 0e3aa59

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

readthedocs/rtd_tests/tests/test_project_forms.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,15 @@ def test_create(self):
542542

543543
self.assertEqual(EnvironmentVariable.objects.count(), 1)
544544
self.assertEqual(EnvironmentVariable.objects.first().name, 'MYTOKEN')
545-
self.assertEqual(EnvironmentVariable.objects.first().value, 'string here')
545+
self.assertEqual(EnvironmentVariable.objects.first().value, "'string here'")
546+
547+
data = {
548+
'name': 'ESCAPED',
549+
'value': r'string escaped here: #$\1[]{}\|',
550+
}
551+
form = EnvironmentVariableForm(data, project=self.project)
552+
form.save()
553+
554+
self.assertEqual(EnvironmentVariable.objects.count(), 2)
555+
self.assertEqual(EnvironmentVariable.objects.first().name, 'ESCAPED')
556+
self.assertEqual(EnvironmentVariable.objects.first().value, r"'string escaped here: #$\1[]{}\|'")

0 commit comments

Comments
 (0)