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
0d3f567a
Kaydet (Commit)
0d3f567a
authored
Eyl 04, 2017
tarafından
Srinivas Reddy Thatiparthy
Kaydeden (comit)
Tim Graham
Eyl 04, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Corrected YearComparisonLookup.get_bound() signature.
üst
af35c69a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
lookups.py
django/db/models/lookups.py
+1
-1
test_lookups.py
tests/lookup/test_lookups.py
+17
-0
No files found.
django/db/models/lookups.py
Dosyayı görüntüle @
0d3f567a
...
@@ -509,7 +509,7 @@ class YearComparisonLookup(YearLookup):
...
@@ -509,7 +509,7 @@ class YearComparisonLookup(YearLookup):
def
get_rhs_op
(
self
,
connection
,
rhs
):
def
get_rhs_op
(
self
,
connection
,
rhs
):
return
connection
.
operators
[
self
.
lookup_name
]
%
rhs
return
connection
.
operators
[
self
.
lookup_name
]
%
rhs
def
get_bound
(
self
):
def
get_bound
(
self
,
start
,
finish
):
raise
NotImplementedError
(
raise
NotImplementedError
(
'subclasses of YearComparisonLookup must provide a get_bound() method'
'subclasses of YearComparisonLookup must provide a get_bound() method'
)
)
...
...
tests/lookup/test_lookups.py
0 → 100644
Dosyayı görüntüle @
0d3f567a
from
datetime
import
datetime
from
django.db.models
import
Value
from
django.db.models.fields
import
DateTimeField
from
django.db.models.lookups
import
YearComparisonLookup
from
django.test
import
SimpleTestCase
class
YearComparisonLookupTests
(
SimpleTestCase
):
def
test_get_bound
(
self
):
look_up
=
YearComparisonLookup
(
lhs
=
Value
(
datetime
(
2010
,
1
,
1
,
0
,
0
,
0
),
output_field
=
DateTimeField
()),
rhs
=
Value
(
datetime
(
2010
,
1
,
1
,
23
,
59
,
59
),
output_field
=
DateTimeField
()),
)
msg
=
'subclasses of YearComparisonLookup must provide a get_bound() method'
with
self
.
assertRaisesMessage
(
NotImplementedError
,
msg
):
look_up
.
get_bound
(
datetime
(
2010
,
1
,
1
,
0
,
0
,
0
),
datetime
(
2010
,
1
,
1
,
23
,
59
,
59
))
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