Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
b7a33ee4
Kaydet (Commit)
b7a33ee4
authored
5 years ago
tarafından
Jon Dufresne
Kaydeden (comit)
Carlton Gibson
5 years ago
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #30468 -- Fixed assertHTMLEqual() to handle all ASCII whitespace in a class attribute.
üst
de6d3afb
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
html.py
django/test/html.py
+1
-1
tests.py
tests/test_utils/tests.py
+14
-0
No files found.
django/test/html.py
Dosyayı görüntüle @
b7a33ee4
...
...
@@ -180,7 +180,7 @@ class Parser(HTMLParser):
# Special case handling of 'class' attribute, so that comparisons of DOM
# instances are not sensitive to ordering of classes.
attrs
=
[
(
name
,
" "
.
join
(
sorted
(
value
.
split
(
" "
)
)))
(
name
,
' '
.
join
(
sorted
(
value
for
value
in
ASCII_WHITESPACE
.
split
(
value
)
if
value
)))
if
name
==
"class"
else
(
name
,
value
)
for
name
,
value
in
attrs
...
...
This diff is collapsed.
Click to expand it.
tests/test_utils/tests.py
Dosyayı görüntüle @
b7a33ee4
...
...
@@ -613,6 +613,20 @@ class HTMLEqualTests(SimpleTestCase):
'<input type="text" id="id_name" />'
,
'<input type="password" id="id_name" />'
)
def
test_class_attribute
(
self
):
pairs
=
[
(
'<p class="foo bar"></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class=" foo bar "></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class=" foo bar "></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class="foo
\t
bar"></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class="
\t
foo
\t
bar
\t
"></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class="
\t\t\t
foo
\t\t\t
bar
\t\t\t
"></p>'
,
'<p class="bar foo"></p>'
),
(
'<p class="
\t
\n
foo
\t\n
bar
\n\t
"></p>'
,
'<p class="bar foo"></p>'
),
]
for
html1
,
html2
in
pairs
:
with
self
.
subTest
(
html1
):
self
.
assertHTMLEqual
(
html1
,
html2
)
def
test_normalize_refs
(
self
):
pairs
=
[
(
'''
,
'''
),
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment