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
8ade277a
Kaydet (Commit)
8ade277a
authored
Ock 14, 2017
tarafından
Josh Smeaton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed tests that rely on hardcoded id with keepdb
üst
bcce6bb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
tests.py
tests/aggregation/tests.py
+18
-18
No files found.
tests/aggregation/tests.py
Dosyayı görüntüle @
8ade277a
...
...
@@ -186,7 +186,7 @@ class AggregateTestCase(TestCase):
page_sum
=
Sum
(
"pages"
))
.
defer
(
'name'
)
.
filter
(
pk
=
self
.
b1
.
pk
)
rows
=
[
(
1
,
"159059725"
,
447
,
"The Definitive Guide to Django: Web Development Done Right"
)
(
self
.
b1
.
id
,
"159059725"
,
447
,
"The Definitive Guide to Django: Web Development Done Right"
)
]
self
.
assertQuerysetEqual
(
qs
.
order_by
(
'pk'
),
rows
,
...
...
@@ -198,7 +198,7 @@ class AggregateTestCase(TestCase):
page_sum
=
Sum
(
"pages"
))
.
defer
(
'name'
)
.
filter
(
pk
=
self
.
b1
.
pk
)
rows
=
[
(
1
,
"159059725"
,
447
,
"Adrian Holovaty"
,
(
self
.
b1
.
id
,
"159059725"
,
447
,
"Adrian Holovaty"
,
"The Definitive Guide to Django: Web Development Done Right"
)
]
self
.
assertQuerysetEqual
(
...
...
@@ -292,15 +292,15 @@ class AggregateTestCase(TestCase):
self
.
assertEqual
(
books
,
[
{
"contact_id"
:
1
,
"id"
:
1
,
"contact_id"
:
self
.
a1
.
id
,
"id"
:
self
.
b1
.
id
,
"isbn"
:
"159059725"
,
"mean_age"
:
34.5
,
"name"
:
"The Definitive Guide to Django: Web Development Done Right"
,
"pages"
:
447
,
"price"
:
Approximate
(
Decimal
(
"30"
)),
"pubdate"
:
datetime
.
date
(
2007
,
12
,
6
),
"publisher_id"
:
1
,
"publisher_id"
:
self
.
p1
.
id
,
"rating"
:
4.5
,
}
]
...
...
@@ -315,7 +315,7 @@ class AggregateTestCase(TestCase):
self
.
assertEqual
(
list
(
books
),
[
{
"pk"
:
1
,
"pk"
:
self
.
b1
.
pk
,
"isbn"
:
"159059725"
,
"mean_age"
:
34.5
,
}
...
...
@@ -335,15 +335,15 @@ class AggregateTestCase(TestCase):
self
.
assertEqual
(
list
(
books
),
[
{
"contact_id"
:
1
,
"id"
:
1
,
"contact_id"
:
self
.
a1
.
id
,
"id"
:
self
.
b1
.
id
,
"isbn"
:
"159059725"
,
"mean_age"
:
34.5
,
"name"
:
"The Definitive Guide to Django: Web Development Done Right"
,
"pages"
:
447
,
"price"
:
Approximate
(
Decimal
(
"30"
)),
"pubdate"
:
datetime
.
date
(
2007
,
12
,
6
),
"publisher_id"
:
1
,
"publisher_id"
:
self
.
p1
.
id
,
"rating"
:
4.5
,
}
]
...
...
@@ -517,7 +517,7 @@ class AggregateTestCase(TestCase):
"""
Sum on a distinct() QuerySet should aggregate only the distinct items.
"""
authors
=
Author
.
objects
.
filter
(
book__in
=
[
5
,
6
])
authors
=
Author
.
objects
.
filter
(
book__in
=
[
self
.
b5
,
self
.
b
6
])
self
.
assertEqual
(
authors
.
count
(),
3
)
distinct_authors
=
authors
.
distinct
()
...
...
@@ -536,7 +536,7 @@ class AggregateTestCase(TestCase):
rating
=
3.5
,
price
=
Decimal
(
"1000"
),
publisher
=
p
,
contact_id
=
1
,
contact_id
=
self
.
a1
.
id
,
pubdate
=
datetime
.
date
(
2008
,
12
,
1
)
)
Book
.
objects
.
create
(
...
...
@@ -546,7 +546,7 @@ class AggregateTestCase(TestCase):
rating
=
4.0
,
price
=
Decimal
(
"1000"
),
publisher
=
p
,
contact_id
=
1
,
contact_id
=
self
.
a1
.
id
,
pubdate
=
datetime
.
date
(
2008
,
12
,
2
)
)
Book
.
objects
.
create
(
...
...
@@ -556,7 +556,7 @@ class AggregateTestCase(TestCase):
rating
=
4.5
,
price
=
Decimal
(
"35"
),
publisher
=
p
,
contact_id
=
1
,
contact_id
=
self
.
a1
.
id
,
pubdate
=
datetime
.
date
(
2008
,
12
,
3
)
)
...
...
@@ -735,25 +735,25 @@ class AggregateTestCase(TestCase):
{
'earliest_book'
:
datetime
.
date
(
1991
,
10
,
15
),
'num_awards'
:
9
,
'id'
:
4
,
'id'
:
self
.
p4
.
id
,
'name'
:
'Morgan Kaufmann'
},
{
'earliest_book'
:
datetime
.
date
(
1995
,
1
,
15
),
'num_awards'
:
7
,
'id'
:
3
,
'id'
:
self
.
p3
.
id
,
'name'
:
'Prentice Hall'
},
{
'earliest_book'
:
datetime
.
date
(
2007
,
12
,
6
),
'num_awards'
:
3
,
'id'
:
1
,
'id'
:
self
.
p1
.
id
,
'name'
:
'Apress'
},
{
'earliest_book'
:
datetime
.
date
(
2008
,
3
,
3
),
'num_awards'
:
1
,
'id'
:
2
,
'id'
:
self
.
p2
.
id
,
'name'
:
'Sams'
}
]
...
...
@@ -777,7 +777,7 @@ class AggregateTestCase(TestCase):
)
self
.
assertEqual
(
list
(
books
),
[
(
1
,
"159059725"
,
34.5
),
(
self
.
b1
.
id
,
"159059725"
,
34.5
),
]
)
...
...
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