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
7fd1571b
Kaydet (Commit)
7fd1571b
authored
Nis 02, 2013
tarafından
Preston Timmons
Kaydeden (comit)
Carl Meyer
Nis 03, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modified admindocs tests to work with unittest2 discovery.
üst
8ce46375
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
43 deletions
+43
-43
__init__.py
django/contrib/admindocs/tests/__init__.py
+1
-36
fields.py
django/contrib/admindocs/tests/fields.py
+0
-7
test_fields.py
django/contrib/admindocs/tests/test_fields.py
+42
-0
No files found.
django/contrib/admindocs/tests/__init__.py
Dosyayı görüntüle @
7fd1571b
from
__future__
import
absolute_import
,
unicode_literals
from
django.contrib.admindocs
import
views
from
django.db.models
import
fields
as
builtin_fields
from
django.utils
import
unittest
from
django.utils.translation
import
ugettext
as
_
from
.
import
fields
class
TestFieldType
(
unittest
.
TestCase
):
def
setUp
(
self
):
pass
def
test_field_name
(
self
):
self
.
assertRaises
(
AttributeError
,
views
.
get_readable_field_data_type
,
"NotAField"
)
def
test_builtin_fields
(
self
):
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
builtin_fields
.
BooleanField
()),
_
(
'Boolean (Either True or False)'
)
)
def
test_custom_fields
(
self
):
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
fields
.
CustomField
()),
'A custom field type'
)
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
fields
.
DescriptionLackingField
()),
_
(
'Field of type:
%(field_type)
s'
)
%
{
'field_type'
:
'DescriptionLackingField'
}
)
from
.test_fields
import
TestFieldType
django/contrib/admindocs/tests/fields.py
deleted
100644 → 0
Dosyayı görüntüle @
8ce46375
from
django.db
import
models
class
CustomField
(
models
.
Field
):
description
=
"A custom field type"
class
DescriptionLackingField
(
models
.
Field
):
pass
django/contrib/admindocs/tests/test_fields.py
0 → 100644
Dosyayı görüntüle @
7fd1571b
from
__future__
import
absolute_import
,
unicode_literals
from
django.contrib.admindocs
import
views
from
django.db
import
models
from
django.db.models
import
fields
from
django.utils
import
unittest
from
django.utils.translation
import
ugettext
as
_
class
CustomField
(
models
.
Field
):
description
=
"A custom field type"
class
DescriptionLackingField
(
models
.
Field
):
pass
class
TestFieldType
(
unittest
.
TestCase
):
def
setUp
(
self
):
pass
def
test_field_name
(
self
):
self
.
assertRaises
(
AttributeError
,
views
.
get_readable_field_data_type
,
"NotAField"
)
def
test_builtin_fields
(
self
):
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
fields
.
BooleanField
()),
_
(
'Boolean (Either True or False)'
)
)
def
test_custom_fields
(
self
):
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
CustomField
()),
'A custom field type'
)
self
.
assertEqual
(
views
.
get_readable_field_data_type
(
DescriptionLackingField
()),
_
(
'Field of type:
%(field_type)
s'
)
%
{
'field_type'
:
'DescriptionLackingField'
}
)
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