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
d02fc8df
Kaydet (Commit)
d02fc8df
authored
Haz 05, 2017
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #21286 -- Enabled serializer tests with date/datetime pk model
üst
5a52d932
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
data.py
tests/serializers/models/data.py
+6
-4
test_data.py
tests/serializers/test_data.py
+13
-12
No files found.
tests/serializers/models/data.py
Dosyayı görüntüle @
d02fc8df
...
@@ -188,11 +188,13 @@ class BooleanPKData(models.Model):
...
@@ -188,11 +188,13 @@ class BooleanPKData(models.Model):
class
CharPKData
(
models
.
Model
):
class
CharPKData
(
models
.
Model
):
data
=
models
.
CharField
(
max_length
=
30
,
primary_key
=
True
)
data
=
models
.
CharField
(
max_length
=
30
,
primary_key
=
True
)
# class DatePKData(models.Model):
# data = models.DateField(primary_key=True)
# class DateTimePKData(models.Model):
class
DatePKData
(
models
.
Model
):
# data = models.DateTimeField(primary_key=True)
data
=
models
.
DateField
(
primary_key
=
True
)
class
DateTimePKData
(
models
.
Model
):
data
=
models
.
DateTimeField
(
primary_key
=
True
)
class
DecimalPKData
(
models
.
Model
):
class
DecimalPKData
(
models
.
Model
):
...
...
tests/serializers/test_data.py
Dosyayı görüntüle @
d02fc8df
...
@@ -16,16 +16,17 @@ from django.test import TestCase
...
@@ -16,16 +16,17 @@ from django.test import TestCase
from
.models
import
(
from
.models
import
(
Anchor
,
AutoNowDateTimeData
,
BigIntegerData
,
BinaryData
,
BooleanData
,
Anchor
,
AutoNowDateTimeData
,
BigIntegerData
,
BinaryData
,
BooleanData
,
BooleanPKData
,
CharData
,
CharPKData
,
DateData
,
DateTimeData
,
DecimalData
,
BooleanPKData
,
CharData
,
CharPKData
,
DateData
,
DatePKData
,
DateTimeData
,
DecimalPKData
,
EmailData
,
EmailPKData
,
ExplicitInheritBaseModel
,
FileData
,
DateTimePKData
,
DecimalData
,
DecimalPKData
,
EmailData
,
EmailPKData
,
FilePathData
,
FilePathPKData
,
FKData
,
FKDataToField
,
FKDataToO2O
,
ExplicitInheritBaseModel
,
FileData
,
FilePathData
,
FilePathPKData
,
FKData
,
FKSelfData
,
FKToUUID
,
FloatData
,
FloatPKData
,
GenericData
,
FKDataToField
,
FKDataToO2O
,
FKSelfData
,
FKToUUID
,
FloatData
,
FloatPKData
,
GenericIPAddressData
,
GenericIPAddressPKData
,
InheritAbstractModel
,
GenericData
,
GenericIPAddressData
,
GenericIPAddressPKData
,
InheritBaseModel
,
IntegerData
,
IntegerPKData
,
Intermediate
,
LengthModel
,
InheritAbstractModel
,
InheritBaseModel
,
IntegerData
,
IntegerPKData
,
M2MData
,
M2MIntermediateData
,
M2MSelfData
,
ModifyingSaveData
,
Intermediate
,
LengthModel
,
M2MData
,
M2MIntermediateData
,
M2MSelfData
,
NullBooleanData
,
O2OData
,
PositiveIntegerData
,
PositiveIntegerPKData
,
ModifyingSaveData
,
NullBooleanData
,
O2OData
,
PositiveIntegerData
,
PositiveSmallIntegerData
,
PositiveSmallIntegerPKData
,
SlugData
,
SlugPKData
,
PositiveIntegerPKData
,
PositiveSmallIntegerData
,
SmallData
,
SmallPKData
,
Tag
,
TextData
,
TimeData
,
UniqueAnchor
,
UUIDData
,
PositiveSmallIntegerPKData
,
SlugData
,
SlugPKData
,
SmallData
,
SmallPKData
,
Tag
,
TextData
,
TimeData
,
UniqueAnchor
,
UUIDData
,
)
)
from
.tests
import
register_tests
from
.tests
import
register_tests
...
@@ -317,8 +318,8 @@ The end."""),
...
@@ -317,8 +318,8 @@ The end."""),
(
pk_obj
,
601
,
BooleanPKData
,
True
),
(
pk_obj
,
601
,
BooleanPKData
,
True
),
(
pk_obj
,
602
,
BooleanPKData
,
False
),
(
pk_obj
,
602
,
BooleanPKData
,
False
),
(
pk_obj
,
610
,
CharPKData
,
"Test Char PKData"
),
(
pk_obj
,
610
,
CharPKData
,
"Test Char PKData"
),
#
(pk_obj, 620, DatePKData, datetime.date(2006, 6, 16)),
(
pk_obj
,
620
,
DatePKData
,
datetime
.
date
(
2006
,
6
,
16
)),
#
(pk_obj, 630, DateTimePKData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
(
pk_obj
,
630
,
DateTimePKData
,
datetime
.
datetime
(
2006
,
6
,
16
,
10
,
42
,
37
)),
(
pk_obj
,
640
,
EmailPKData
,
"hovercraft@example.com"
),
(
pk_obj
,
640
,
EmailPKData
,
"hovercraft@example.com"
),
# (pk_obj, 650, FilePKData, 'file:///foo/bar/whiz.txt'),
# (pk_obj, 650, FilePKData, 'file:///foo/bar/whiz.txt'),
(
pk_obj
,
660
,
FilePathPKData
,
"/foo/bar/whiz.txt"
),
(
pk_obj
,
660
,
FilePathPKData
,
"/foo/bar/whiz.txt"
),
...
...
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