| 1 | """ |
| 2 | Tests for TokenParser behavior in the face of quoted strings with spaces. |
| 3 | |
| 4 | >>> from django.template import TokenParser |
| 5 | |
| 6 | |
| 7 | Test case 1: {% tag thevar|filter sometag %} |
| 8 | |
| 9 | >>> p = TokenParser("tag thevar|filter sometag") |
| 10 | >>> p.tagname |
| 11 | 'tag' |
| 12 | |
| 13 | >>> p.value() |
| 14 | 'thevar|filter' |
| 15 | |
| 16 | >>> p.more() |
| 17 | True |
| 18 | |
| 19 | >>> p.tag() |
| 20 | 'sometag' |
| 21 | |
| 22 | >>> p.more() |
| 23 | False |
| 24 | |
| 25 | |
| 26 | Test case 2: {% tag "a value"|filter sometag %} |
| 27 | |
| 28 | >>> p = TokenParser('tag "a value"|filter sometag') |
| 29 | >>> p.tagname |
| 30 | 'tag' |
| 31 | |
| 32 | >>> p.value() |
| 33 | '"a value"|filter' |
| 34 | |
| 35 | >>> p.more() |
| 36 | True |
| 37 | |
| 38 | >>> p.tag() |
| 39 | 'sometag' |
| 40 | |
| 41 | |
| 42 | >>> p.more() |
| 43 | False |
| 44 | """ |