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
f67e18f3
Kaydet (Commit)
f67e18f3
authored
Kas 03, 2013
tarafından
Alex Gaynor
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed all E251 violations
üst
c347f78c
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
37 additions
and
37 deletions
+37
-37
setup.cfg
setup.cfg
+1
-1
tests.py
tests/datatypes/tests.py
+1
-1
models.py
tests/force_insert_update/models.py
+1
-1
test_fields.py
tests/forms_tests/tests/test_fields.py
+1
-1
test_media.py
tests/forms_tests/tests/test_media.py
+8
-8
test_validators.py
tests/forms_tests/tests/test_validators.py
+4
-4
models.py
tests/initial_sql_regress/models.py
+1
-1
test_operations.py
tests/migrations/test_operations.py
+1
-1
test_optimizer.py
tests/migrations/test_optimizer.py
+1
-1
tests.py
tests/null_fk/tests.py
+2
-2
tests.py
tests/properties/tests.py
+1
-1
tests.py
tests/schema/tests.py
+12
-12
tests.py
tests/select_related_regress/tests.py
+2
-2
tests.py
tests/signed_cookies_tests/tests.py
+1
-1
No files found.
setup.cfg
Dosyayı görüntüle @
f67e18f3
...
...
@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8]
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py,./django/utils/six.py,./django/conf/app_template/*
ignore=E124,E125,E127,E128,E
251,E
501,W601
ignore=E124,E125,E127,E128,E501,W601
[metadata]
license-file = LICENSE
...
...
tests/datatypes/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -61,7 +61,7 @@ class DataTypesTestCase(TestCase):
Donut
.
objects
.
filter
(
baked_date__year
=
2006
)[
0
]
.
name
)
Donut
.
objects
.
create
(
name
=
'Apple Fritter'
,
consumed_at
=
datetime
.
datetime
(
year
=
2007
,
month
=
4
,
day
=
20
,
hour
=
16
,
minute
=
19
,
second
=
59
))
consumed_at
=
datetime
.
datetime
(
year
=
2007
,
month
=
4
,
day
=
20
,
hour
=
16
,
minute
=
19
,
second
=
59
))
self
.
assertEqual
([
'Apple Fritter'
,
'Date Test 2007'
],
list
(
Donut
.
objects
.
filter
(
consumed_at__year
=
2007
)
.
order_by
(
'name'
)
.
values_list
(
'name'
,
flat
=
True
)))
...
...
tests/force_insert_update/models.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -6,7 +6,7 @@ from django.db import models
class
Counter
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
10
)
name
=
models
.
CharField
(
max_length
=
10
)
value
=
models
.
IntegerField
()
...
...
tests/forms_tests/tests/test_fields.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -691,7 +691,7 @@ class FieldsTests(SimpleTestCase):
self
.
assertEqual
(
SimpleUploadedFile
,
type
(
f
.
clean
(
SimpleUploadedFile
(
'name'
,
b
'Some File Content'
),
'files/test4.pdf'
)))
def
test_filefield_2
(
self
):
f
=
FileField
(
max_length
=
5
)
f
=
FileField
(
max_length
=
5
)
self
.
assertRaisesMessage
(
ValidationError
,
"'Ensure this filename has at most 5 characters (it has 18).'"
,
f
.
clean
,
SimpleUploadedFile
(
'test_maxlength.txt'
,
b
'hello world'
))
self
.
assertEqual
(
'files/test1.pdf'
,
f
.
clean
(
''
,
'files/test1.pdf'
))
self
.
assertEqual
(
'files/test2.pdf'
,
f
.
clean
(
None
,
'files/test2.pdf'
))
...
...
tests/forms_tests/tests/test_media.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -133,7 +133,7 @@ class FormsMediaTestCase(TestCase):
# Widget media can be defined as a property
class
MyWidget4
(
TextInput
):
def
_media
(
self
):
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
media
=
property
(
_media
)
w4
=
MyWidget4
()
...
...
@@ -143,7 +143,7 @@ class FormsMediaTestCase(TestCase):
# Media properties can reference the media of their parents
class
MyWidget5
(
MyWidget4
):
def
_media
(
self
):
return
super
(
MyWidget5
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
return
super
(
MyWidget5
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
media
=
property
(
_media
)
w5
=
MyWidget5
()
...
...
@@ -164,7 +164,7 @@ class FormsMediaTestCase(TestCase):
class
MyWidget6
(
MyWidget1
):
def
_media
(
self
):
return
super
(
MyWidget6
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
return
super
(
MyWidget6
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
media
=
property
(
_media
)
w6
=
MyWidget6
()
...
...
@@ -228,7 +228,7 @@ class FormsMediaTestCase(TestCase):
class
MyWidget4
(
TextInput
):
def
_media
(
self
):
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
media
=
property
(
_media
)
class
MyWidget9
(
MyWidget4
):
...
...
@@ -585,7 +585,7 @@ class StaticFormsMediaTestCase(TestCase):
# Widget media can be defined as a property
class
MyWidget4
(
TextInput
):
def
_media
(
self
):
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
media
=
property
(
_media
)
w4
=
MyWidget4
()
...
...
@@ -595,7 +595,7 @@ class StaticFormsMediaTestCase(TestCase):
# Media properties can reference the media of their parents
class
MyWidget5
(
MyWidget4
):
def
_media
(
self
):
return
super
(
MyWidget5
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
return
super
(
MyWidget5
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
media
=
property
(
_media
)
w5
=
MyWidget5
()
...
...
@@ -616,7 +616,7 @@ class StaticFormsMediaTestCase(TestCase):
class
MyWidget6
(
MyWidget1
):
def
_media
(
self
):
return
super
(
MyWidget6
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
return
super
(
MyWidget6
,
self
)
.
media
+
Media
(
css
=
{
'all'
:
(
'/other/path'
,)},
js
=
(
'/other/js'
,))
media
=
property
(
_media
)
w6
=
MyWidget6
()
...
...
@@ -680,7 +680,7 @@ class StaticFormsMediaTestCase(TestCase):
class
MyWidget4
(
TextInput
):
def
_media
(
self
):
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
return
Media
(
css
=
{
'all'
:
(
'/some/path'
,)},
js
=
(
'/some/js'
,))
media
=
property
(
_media
)
class
MyWidget9
(
MyWidget4
):
...
...
tests/forms_tests/tests/test_validators.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -9,15 +9,15 @@ from django.core.exceptions import ValidationError
class
UserForm
(
forms
.
Form
):
full_name
=
forms
.
CharField
(
max_length
=
50
,
validators
=
[
max_length
=
50
,
validators
=
[
validators
.
validate_integer
,
validators
.
validate_email
,
]
)
string
=
forms
.
CharField
(
max_length
=
50
,
validators
=
[
max_length
=
50
,
validators
=
[
validators
.
RegexValidator
(
regex
=
'^[a-zA-Z]*$'
,
message
=
"Letters only."
,
...
...
tests/initial_sql_regress/models.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -6,4 +6,4 @@ from django.db import models
class
Simple
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
50
)
name
=
models
.
CharField
(
max_length
=
50
)
tests/migrations/test_operations.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -303,7 +303,7 @@ class OperationTests(MigrationTestBase):
operation
=
migrations
.
RunSQL
(
"CREATE TABLE i_love_ponies (id int, special_thing int)"
,
"DROP TABLE i_love_ponies"
,
state_operations
=
[
migrations
.
CreateModel
(
"SomethingElse"
,
[(
"id"
,
models
.
AutoField
(
primary_key
=
True
))])],
state_operations
=
[
migrations
.
CreateModel
(
"SomethingElse"
,
[(
"id"
,
models
.
AutoField
(
primary_key
=
True
))])],
)
# Test the state alteration
new_state
=
project_state
.
clone
()
...
...
tests/migrations/test_optimizer.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -64,7 +64,7 @@ class OptimizerTests(TestCase):
self
.
assertOptimizesTo
(
[
migrations
.
DeleteModel
(
"Foo"
)],
[
migrations
.
DeleteModel
(
"Foo"
)],
exact
=
1
,
exact
=
1
,
)
def
test_create_delete_model
(
self
):
...
...
tests/null_fk/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -31,7 +31,7 @@ class NullFkTests(TestCase):
(
c1
.
id
,
'My first comment'
,
'<Post: First Post>'
),
(
c2
.
id
,
'My second comment'
,
'None'
)
],
transform
=
lambda
c
:
(
c
.
id
,
c
.
comment_text
,
repr
(
c
.
post
))
transform
=
lambda
c
:
(
c
.
id
,
c
.
comment_text
,
repr
(
c
.
post
))
)
# Regression test for #7530, #7716.
...
...
@@ -43,7 +43,7 @@ class NullFkTests(TestCase):
(
c1
.
id
,
'My first comment'
,
'<Post: First Post>'
),
(
c2
.
id
,
'My second comment'
,
'None'
)
],
transform
=
lambda
c
:
(
c
.
id
,
c
.
comment_text
,
repr
(
c
.
post
))
transform
=
lambda
c
:
(
c
.
id
,
c
.
comment_text
,
repr
(
c
.
post
))
)
def
test_combine_isnull
(
self
):
...
...
tests/properties/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -19,6 +19,6 @@ class PropertyTests(TestCase):
self
.
assertRaises
(
AttributeError
,
setattr
,
self
.
a
,
'full_name'
,
'Paul McCartney'
)
# But "full_name_2" has, and it can be used to initialise the class.
a2
=
Person
(
full_name_2
=
'Paul McCartney'
)
a2
=
Person
(
full_name_2
=
'Paul McCartney'
)
a2
.
save
()
self
.
assertEqual
(
a2
.
first_name
,
'Paul'
)
tests/schema/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -106,9 +106,9 @@ class SchemaTests(TransactionTestCase):
# Make sure the FK constraint is present
with
self
.
assertRaises
(
IntegrityError
):
Book
.
objects
.
create
(
author_id
=
1
,
title
=
"Much Ado About Foreign Keys"
,
pub_date
=
datetime
.
datetime
.
now
(),
author_id
=
1
,
title
=
"Much Ado About Foreign Keys"
,
pub_date
=
datetime
.
datetime
.
now
(),
)
# Repoint the FK constraint
new_field
=
ForeignKey
(
Tag
)
...
...
@@ -211,7 +211,7 @@ class SchemaTests(TransactionTestCase):
Author
,
Author
.
_meta
.
get_field_by_name
(
"name"
)[
0
],
new_field
,
strict
=
True
,
strict
=
True
,
)
# Ensure the field is right afterwards
columns
=
self
.
column_classes
(
Author
)
...
...
@@ -337,7 +337,7 @@ class SchemaTests(TransactionTestCase):
Author
,
Author
.
_meta
.
get_field_by_name
(
"height"
)[
0
],
new_field
,
strict
=
True
,
strict
=
True
,
)
constraints
=
connection
.
introspection
.
get_constraints
(
connection
.
cursor
(),
Author
.
_meta
.
db_table
)
for
name
,
details
in
constraints
.
items
():
...
...
@@ -349,7 +349,7 @@ class SchemaTests(TransactionTestCase):
Author
,
new_field
,
Author
.
_meta
.
get_field_by_name
(
"height"
)[
0
],
strict
=
True
,
strict
=
True
,
)
constraints
=
connection
.
introspection
.
get_constraints
(
connection
.
cursor
(),
Author
.
_meta
.
db_table
)
for
name
,
details
in
constraints
.
items
():
...
...
@@ -377,7 +377,7 @@ class SchemaTests(TransactionTestCase):
Tag
,
Tag
.
_meta
.
get_field_by_name
(
"slug"
)[
0
],
new_field
,
strict
=
True
,
strict
=
True
,
)
# Ensure the field is no longer unique
Tag
.
objects
.
create
(
title
=
"foo"
,
slug
=
"foo"
)
...
...
@@ -391,7 +391,7 @@ class SchemaTests(TransactionTestCase):
Tag
,
new_field
,
new_new_field
,
strict
=
True
,
strict
=
True
,
)
# Ensure the field is unique again
Tag
.
objects
.
create
(
title
=
"foo"
,
slug
=
"foo"
)
...
...
@@ -405,7 +405,7 @@ class SchemaTests(TransactionTestCase):
Tag
,
Tag
.
_meta
.
get_field_by_name
(
"slug"
)[
0
],
TagUniqueRename
.
_meta
.
get_field_by_name
(
"slug2"
)[
0
],
strict
=
True
,
strict
=
True
,
)
# Ensure the field is still unique
TagUniqueRename
.
objects
.
create
(
title
=
"foo"
,
slug2
=
"foo"
)
...
...
@@ -572,7 +572,7 @@ class SchemaTests(TransactionTestCase):
Book
,
Book
.
_meta
.
get_field_by_name
(
"title"
)[
0
],
new_field
,
strict
=
True
,
strict
=
True
,
)
# Ensure the table is there and has no index
self
.
assertNotIn
(
...
...
@@ -585,7 +585,7 @@ class SchemaTests(TransactionTestCase):
Book
,
new_field
,
Book
.
_meta
.
get_field_by_name
(
"title"
)[
0
],
strict
=
True
,
strict
=
True
,
)
# Ensure the table is there and has the index again
self
.
assertIn
(
...
...
@@ -610,7 +610,7 @@ class SchemaTests(TransactionTestCase):
BookWithSlug
,
BookWithSlug
.
_meta
.
get_field_by_name
(
"slug"
)[
0
],
new_field2
,
strict
=
True
,
strict
=
True
,
)
self
.
assertNotIn
(
"slug"
,
...
...
tests/select_related_regress/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -58,8 +58,8 @@ class SelectRelatedRegressTests(TestCase):
usp
=
Person
.
objects
.
create
(
user
=
us
)
uo
=
TUser
.
objects
.
create
(
name
=
"org"
)
uop
=
Person
.
objects
.
create
(
user
=
uo
)
s
=
Student
.
objects
.
create
(
person
=
usp
)
o
=
Organizer
.
objects
.
create
(
person
=
uop
)
s
=
Student
.
objects
.
create
(
person
=
usp
)
o
=
Organizer
.
objects
.
create
(
person
=
uop
)
c
=
Class
.
objects
.
create
(
org
=
o
)
Enrollment
.
objects
.
create
(
std
=
s
,
cls
=
c
)
...
...
tests/signed_cookies_tests/tests.py
Dosyayı görüntüle @
f67e18f3
...
...
@@ -59,6 +59,6 @@ class SignedCookieTest(TestCase):
self
.
assertEqual
(
request
.
get_signed_cookie
(
'c'
,
max_age
=
12
),
value
)
self
.
assertEqual
(
request
.
get_signed_cookie
(
'c'
,
max_age
=
11
),
value
)
self
.
assertRaises
(
signing
.
SignatureExpired
,
request
.
get_signed_cookie
,
'c'
,
max_age
=
10
)
request
.
get_signed_cookie
,
'c'
,
max_age
=
10
)
finally
:
time
.
time
=
_time
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