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
adedc310
Kaydet (Commit)
adedc310
authored
Eki 10, 2013
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed "redefinition of unused 'foo' from line X" pyflakes warnings.
üst
cec11a33
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
27 additions
and
34 deletions
+27
-34
test_basic.py
django/contrib/auth/tests/test_basic.py
+0
-1
__init__.py
django/contrib/gis/geos/prototypes/__init__.py
+1
-1
__init__.py
django/contrib/sitemaps/__init__.py
+0
-1
base.py
django/db/backends/mysql/base.py
+0
-1
state.py
django/db/migrations/state.py
+3
-3
base.py
django/db/models/base.py
+1
-1
admin.py
tests/admin_views/admin.py
+0
-5
models.py
tests/base/models.py
+1
-1
test_media.py
tests/forms_tests/tests/test_media.py
+1
-1
tests.py
tests/m2m_and_m2o/tests.py
+1
-2
tests.py
tests/mail/tests.py
+13
-11
tests.py
tests/multiple_database/tests.py
+6
-6
No files found.
django/contrib/auth/tests/test_basic.py
Dosyayı görüntüle @
adedc310
...
@@ -23,7 +23,6 @@ from django.utils.six import binary_type, PY2, StringIO
...
@@ -23,7 +23,6 @@ from django.utils.six import binary_type, PY2, StringIO
def
user_model_swapped
(
**
kwargs
):
def
user_model_swapped
(
**
kwargs
):
if
kwargs
[
'setting'
]
==
'AUTH_USER_MODEL'
:
if
kwargs
[
'setting'
]
==
'AUTH_USER_MODEL'
:
from
django.db.models.manager
import
ensure_default_manager
from
django.db.models.manager
import
ensure_default_manager
from
django.contrib.auth.models
import
User
# Reset User manager
# Reset User manager
setattr
(
User
,
'objects'
,
User
.
_default_manager
)
setattr
(
User
,
'objects'
,
User
.
_default_manager
)
ensure_default_manager
(
User
)
ensure_default_manager
(
User
)
...
...
django/contrib/gis/geos/prototypes/__init__.py
Dosyayı görüntüle @
adedc310
...
@@ -24,7 +24,7 @@ from django.contrib.gis.geos.prototypes.misc import *
...
@@ -24,7 +24,7 @@ from django.contrib.gis.geos.prototypes.misc import *
from
django.contrib.gis.geos.prototypes.predicates
import
(
geos_hasz
,
geos_isempty
,
from
django.contrib.gis.geos.prototypes.predicates
import
(
geos_hasz
,
geos_isempty
,
geos_isring
,
geos_issimple
,
geos_isvalid
,
geos_contains
,
geos_crosses
,
geos_isring
,
geos_issimple
,
geos_isvalid
,
geos_contains
,
geos_crosses
,
geos_disjoint
,
geos_equals
,
geos_equalsexact
,
geos_intersects
,
geos_disjoint
,
geos_equals
,
geos_equalsexact
,
geos_intersects
,
geos_
intersects
,
geos_
overlaps
,
geos_relatepattern
,
geos_touches
,
geos_within
)
geos_overlaps
,
geos_relatepattern
,
geos_touches
,
geos_within
)
# Topology routines
# Topology routines
from
django.contrib.gis.geos.prototypes.topology
import
*
from
django.contrib.gis.geos.prototypes.topology
import
*
django/contrib/sitemaps/__init__.py
Dosyayı görüntüle @
adedc310
...
@@ -30,7 +30,6 @@ def ping_google(sitemap_url=None, ping_url=PING_URL):
...
@@ -30,7 +30,6 @@ def ping_google(sitemap_url=None, ping_url=PING_URL):
if
sitemap_url
is
None
:
if
sitemap_url
is
None
:
raise
SitemapNotFound
(
"You didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected."
)
raise
SitemapNotFound
(
"You didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected."
)
from
django.contrib.sites.models
import
Site
current_site
=
Site
.
objects
.
get_current
()
current_site
=
Site
.
objects
.
get_current
()
url
=
"http://
%
s
%
s"
%
(
current_site
.
domain
,
sitemap_url
)
url
=
"http://
%
s
%
s"
%
(
current_site
.
domain
,
sitemap_url
)
params
=
urlencode
({
'sitemap'
:
url
})
params
=
urlencode
({
'sitemap'
:
url
})
...
...
django/db/backends/mysql/base.py
Dosyayı görüntüle @
adedc310
...
@@ -43,7 +43,6 @@ from django.db.backends.mysql.introspection import DatabaseIntrospection
...
@@ -43,7 +43,6 @@ from django.db.backends.mysql.introspection import DatabaseIntrospection
from
django.db.backends.mysql.validation
import
DatabaseValidation
from
django.db.backends.mysql.validation
import
DatabaseValidation
from
django.utils.encoding
import
force_str
,
force_text
from
django.utils.encoding
import
force_str
,
force_text
from
django.db.backends.mysql.schema
import
DatabaseSchemaEditor
from
django.db.backends.mysql.schema
import
DatabaseSchemaEditor
from
django.utils.encoding
import
force_str
from
django.utils.functional
import
cached_property
from
django.utils.functional
import
cached_property
from
django.utils.safestring
import
SafeBytes
,
SafeText
from
django.utils.safestring
import
SafeBytes
,
SafeText
from
django.utils
import
six
from
django.utils
import
six
...
...
django/db/migrations/state.py
Dosyayı görüntüle @
adedc310
...
@@ -53,11 +53,11 @@ class ProjectState(object):
...
@@ -53,11 +53,11 @@ class ProjectState(object):
@classmethod
@classmethod
def
from_app_cache
(
cls
,
app_cache
):
def
from_app_cache
(
cls
,
app_cache
):
"Takes in an AppCache and returns a ProjectState matching it"
"Takes in an AppCache and returns a ProjectState matching it"
models
=
{}
app_
models
=
{}
for
model
in
app_cache
.
get_models
():
for
model
in
app_cache
.
get_models
():
model_state
=
ModelState
.
from_model
(
model
)
model_state
=
ModelState
.
from_model
(
model
)
models
[(
model_state
.
app_label
,
model_state
.
name
.
lower
())]
=
model_state
app_
models
[(
model_state
.
app_label
,
model_state
.
name
.
lower
())]
=
model_state
return
cls
(
models
)
return
cls
(
app_
models
)
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
set
(
self
.
models
.
keys
())
!=
set
(
other
.
models
.
keys
()):
if
set
(
self
.
models
.
keys
())
!=
set
(
other
.
models
.
keys
()):
...
...
django/db/models/base.py
Dosyayı görüntüle @
adedc310
...
@@ -276,7 +276,7 @@ class ModelBase(type):
...
@@ -276,7 +276,7 @@ class ModelBase(type):
def
copy_managers
(
cls
,
base_managers
):
def
copy_managers
(
cls
,
base_managers
):
# This is in-place sorting of an Options attribute, but that's fine.
# This is in-place sorting of an Options attribute, but that's fine.
base_managers
.
sort
()
base_managers
.
sort
()
for
_
,
mgr_name
,
manager
in
base_managers
:
for
_
,
mgr_name
,
manager
in
base_managers
:
# NOQA (redefinition of _)
val
=
getattr
(
cls
,
mgr_name
,
None
)
val
=
getattr
(
cls
,
mgr_name
,
None
)
if
not
val
or
val
is
manager
:
if
not
val
or
val
is
manager
:
new_manager
=
manager
.
_copy_to_model
(
cls
)
new_manager
=
manager
.
_copy_to_model
(
cls
)
...
...
tests/admin_views/admin.py
Dosyayı görüntüle @
adedc310
...
@@ -567,11 +567,6 @@ class AlbumAdmin(admin.ModelAdmin):
...
@@ -567,11 +567,6 @@ class AlbumAdmin(admin.ModelAdmin):
list_filter
=
[
'title'
]
list_filter
=
[
'title'
]
class
WorkHourAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'datum'
,
'employee'
)
list_filter
=
(
'employee'
,)
class
PrePopulatedPostLargeSlugAdmin
(
admin
.
ModelAdmin
):
class
PrePopulatedPostLargeSlugAdmin
(
admin
.
ModelAdmin
):
prepopulated_fields
=
{
prepopulated_fields
=
{
'slug'
:
(
'title'
,)
'slug'
:
(
'title'
,)
...
...
tests/base/models.py
Dosyayı görüntüle @
adedc310
...
@@ -20,6 +20,6 @@ class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
...
@@ -20,6 +20,6 @@ class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
# still does not fail to create the model.
# still does not fail to create the model.
if
six
.
PY2
:
if
six
.
PY2
:
class
MyModel
(
models
.
Model
):
class
My
Python2
Model
(
models
.
Model
):
"""Model subclass with a custom base using __metaclass__."""
"""Model subclass with a custom base using __metaclass__."""
__metaclass__
=
CustomBaseModel
__metaclass__
=
CustomBaseModel
tests/forms_tests/tests/test_media.py
Dosyayı görüntüle @
adedc310
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
django.forms
import
TextInput
,
Media
,
TextInput
,
CharField
,
Form
,
MultiWidget
from
django.forms
import
Media
,
TextInput
,
CharField
,
Form
,
MultiWidget
from
django.template
import
Template
,
Context
from
django.template
import
Template
,
Context
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
...
tests/m2m_and_m2o/tests.py
Dosyayı görüntüle @
adedc310
...
@@ -74,7 +74,7 @@ class RelatedObjectTests(TestCase):
...
@@ -74,7 +74,7 @@ class RelatedObjectTests(TestCase):
lambda
i
:
i
.
num
lambda
i
:
i
.
num
)
)
class
RelatedObjectTests
(
TestCase
):
class
RelatedObject
Unicode
Tests
(
TestCase
):
def
test_m2m_with_unicode_reference
(
self
):
def
test_m2m_with_unicode_reference
(
self
):
"""
"""
Regression test for #6045: references to other models can be unicode
Regression test for #6045: references to other models can be unicode
...
@@ -85,4 +85,3 @@ class RelatedObjectTests(TestCase):
...
@@ -85,4 +85,3 @@ class RelatedObjectTests(TestCase):
m2
.
others
.
add
(
m1
)
# used to cause an error (see ticket #6045)
m2
.
others
.
add
(
m1
)
# used to cause an error (see ticket #6045)
m2
.
save
()
m2
.
save
()
list
(
m2
.
others
.
all
())
# Force retrieval.
list
(
m2
.
others
.
all
())
# Force retrieval.
tests/mail/tests.py
Dosyayı görüntüle @
adedc310
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
asyncore
import
asyncore
import
email
from
email
import
message_from_file
,
message_from_string
from
email.mime.text
import
MIMEText
from
email.mime.text
import
MIMEText
import
os
import
os
import
shutil
import
shutil
...
@@ -24,6 +24,11 @@ from django.utils.encoding import force_str, force_text
...
@@ -24,6 +24,11 @@ from django.utils.encoding import force_str, force_text
from
django.utils.six
import
PY3
,
StringIO
,
string_types
from
django.utils.six
import
PY3
,
StringIO
,
string_types
from
django.utils.translation
import
ugettext_lazy
from
django.utils.translation
import
ugettext_lazy
if
PY3
:
from
email.utils
import
parseaddr
else
:
from
email.Utils
import
parseaddr
class
HeadersCheckMixin
(
object
):
class
HeadersCheckMixin
(
object
):
...
@@ -244,7 +249,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
...
@@ -244,7 +249,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
msg
.
attach_alternative
(
html_content
,
"text/html"
)
msg
.
attach_alternative
(
html_content
,
"text/html"
)
msg
.
attach
(
"an attachment.pdf"
,
b
"
%
PDF-1.4.
%
..."
,
mimetype
=
"application/pdf"
)
msg
.
attach
(
"an attachment.pdf"
,
b
"
%
PDF-1.4.
%
..."
,
mimetype
=
"application/pdf"
)
msg_str
=
msg
.
message
()
.
as_string
()
msg_str
=
msg
.
message
()
.
as_string
()
message
=
email
.
message_from_string
(
msg_str
)
message
=
message_from_string
(
msg_str
)
self
.
assertTrue
(
message
.
is_multipart
())
self
.
assertTrue
(
message
.
is_multipart
())
self
.
assertEqual
(
message
.
get_content_type
(),
'multipart/mixed'
)
self
.
assertEqual
(
message
.
get_content_type
(),
'multipart/mixed'
)
self
.
assertEqual
(
message
.
get_default_type
(),
'text/plain'
)
self
.
assertEqual
(
message
.
get_default_type
(),
'text/plain'
)
...
@@ -261,7 +266,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
...
@@ -261,7 +266,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
# Unicode in file name
# Unicode in file name
msg
.
attach
(
"une pièce jointe.pdf"
,
b
"
%
PDF-1.4.
%
..."
,
mimetype
=
"application/pdf"
)
msg
.
attach
(
"une pièce jointe.pdf"
,
b
"
%
PDF-1.4.
%
..."
,
mimetype
=
"application/pdf"
)
msg_str
=
msg
.
message
()
.
as_string
()
msg_str
=
msg
.
message
()
.
as_string
()
message
=
email
.
message_from_string
(
msg_str
)
message
=
message_from_string
(
msg_str
)
payload
=
message
.
get_payload
()
payload
=
message
.
get_payload
()
self
.
assertEqual
(
payload
[
1
]
.
get_filename
(),
'une pièce jointe.pdf'
)
self
.
assertEqual
(
payload
[
1
]
.
get_filename
(),
'une pièce jointe.pdf'
)
...
@@ -689,7 +694,7 @@ class FileBackendTests(BaseEmailBackendTests, SimpleTestCase):
...
@@ -689,7 +694,7 @@ class FileBackendTests(BaseEmailBackendTests, SimpleTestCase):
for
filename
in
os
.
listdir
(
self
.
tmp_dir
):
for
filename
in
os
.
listdir
(
self
.
tmp_dir
):
with
open
(
os
.
path
.
join
(
self
.
tmp_dir
,
filename
),
'r'
)
as
fp
:
with
open
(
os
.
path
.
join
(
self
.
tmp_dir
,
filename
),
'r'
)
as
fp
:
session
=
force_text
(
fp
.
read
())
.
split
(
'
\n
'
+
(
'-'
*
79
)
+
'
\n
'
)
session
=
force_text
(
fp
.
read
())
.
split
(
'
\n
'
+
(
'-'
*
79
)
+
'
\n
'
)
messages
.
extend
(
email
.
message_from_string
(
force_str
(
m
))
for
m
in
session
if
m
)
messages
.
extend
(
message_from_string
(
force_str
(
m
))
for
m
in
session
if
m
)
return
messages
return
messages
def
test_file_sessions
(
self
):
def
test_file_sessions
(
self
):
...
@@ -700,7 +705,7 @@ class FileBackendTests(BaseEmailBackendTests, SimpleTestCase):
...
@@ -700,7 +705,7 @@ class FileBackendTests(BaseEmailBackendTests, SimpleTestCase):
self
.
assertEqual
(
len
(
os
.
listdir
(
self
.
tmp_dir
)),
1
)
self
.
assertEqual
(
len
(
os
.
listdir
(
self
.
tmp_dir
)),
1
)
with
open
(
os
.
path
.
join
(
self
.
tmp_dir
,
os
.
listdir
(
self
.
tmp_dir
)[
0
]))
as
fp
:
with
open
(
os
.
path
.
join
(
self
.
tmp_dir
,
os
.
listdir
(
self
.
tmp_dir
)[
0
]))
as
fp
:
message
=
email
.
message_from_file
(
fp
)
message
=
message_from_file
(
fp
)
self
.
assertEqual
(
message
.
get_content_type
(),
'text/plain'
)
self
.
assertEqual
(
message
.
get_content_type
(),
'text/plain'
)
self
.
assertEqual
(
message
.
get
(
'subject'
),
'Subject'
)
self
.
assertEqual
(
message
.
get
(
'subject'
),
'Subject'
)
self
.
assertEqual
(
message
.
get
(
'from'
),
'from@example.com'
)
self
.
assertEqual
(
message
.
get
(
'from'
),
'from@example.com'
)
...
@@ -742,7 +747,7 @@ class ConsoleBackendTests(BaseEmailBackendTests, SimpleTestCase):
...
@@ -742,7 +747,7 @@ class ConsoleBackendTests(BaseEmailBackendTests, SimpleTestCase):
def
get_mailbox_content
(
self
):
def
get_mailbox_content
(
self
):
messages
=
force_text
(
self
.
stream
.
getvalue
())
.
split
(
'
\n
'
+
(
'-'
*
79
)
+
'
\n
'
)
messages
=
force_text
(
self
.
stream
.
getvalue
())
.
split
(
'
\n
'
+
(
'-'
*
79
)
+
'
\n
'
)
return
[
email
.
message_from_string
(
force_str
(
m
))
for
m
in
messages
if
m
]
return
[
message_from_string
(
force_str
(
m
))
for
m
in
messages
if
m
]
def
test_console_stream_kwarg
(
self
):
def
test_console_stream_kwarg
(
self
):
"""
"""
...
@@ -788,11 +793,8 @@ class FakeSMTPServer(smtpd.SMTPServer, threading.Thread):
...
@@ -788,11 +793,8 @@ class FakeSMTPServer(smtpd.SMTPServer, threading.Thread):
self
.
sink_lock
=
threading
.
Lock
()
self
.
sink_lock
=
threading
.
Lock
()
def
process_message
(
self
,
peer
,
mailfrom
,
rcpttos
,
data
):
def
process_message
(
self
,
peer
,
mailfrom
,
rcpttos
,
data
):
m
=
email
.
message_from_string
(
data
)
m
=
message_from_string
(
data
)
if
PY3
:
maddr
=
parseaddr
(
m
.
get
(
'from'
))[
1
]
maddr
=
email
.
utils
.
parseaddr
(
m
.
get
(
'from'
))[
1
]
else
:
maddr
=
email
.
Utils
.
parseaddr
(
m
.
get
(
'from'
))[
1
]
if
mailfrom
!=
maddr
:
if
mailfrom
!=
maddr
:
return
"553 '
%
s' != '
%
s'"
%
(
mailfrom
,
maddr
)
return
"553 '
%
s' != '
%
s'"
%
(
mailfrom
,
maddr
)
with
self
.
sink_lock
:
with
self
.
sink_lock
:
...
...
tests/multiple_database/tests.py
Dosyayı görüntüle @
adedc310
...
@@ -928,21 +928,21 @@ class ConnectionRouterTestCase(TestCase):
...
@@ -928,21 +928,21 @@ class ConnectionRouterTestCase(TestCase):
'multiple_database.tests.TestRouter'
,
'multiple_database.tests.TestRouter'
,
'multiple_database.tests.WriteRouter'
])
'multiple_database.tests.WriteRouter'
])
def
test_router_init_default
(
self
):
def
test_router_init_default
(
self
):
router
=
ConnectionRouter
()
connection_
router
=
ConnectionRouter
()
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
router
.
routers
],
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
connection_
router
.
routers
],
[
'TestRouter'
,
'WriteRouter'
])
[
'TestRouter'
,
'WriteRouter'
])
def
test_router_init_arg
(
self
):
def
test_router_init_arg
(
self
):
router
=
ConnectionRouter
([
connection_
router
=
ConnectionRouter
([
'multiple_database.tests.TestRouter'
,
'multiple_database.tests.TestRouter'
,
'multiple_database.tests.WriteRouter'
'multiple_database.tests.WriteRouter'
])
])
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
router
.
routers
],
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
connection_
router
.
routers
],
[
'TestRouter'
,
'WriteRouter'
])
[
'TestRouter'
,
'WriteRouter'
])
# Init with instances instead of strings
# Init with instances instead of strings
router
=
ConnectionRouter
([
TestRouter
(),
WriteRouter
()])
connection_
router
=
ConnectionRouter
([
TestRouter
(),
WriteRouter
()])
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
router
.
routers
],
self
.
assertListEqual
([
r
.
__class__
.
__name__
for
r
in
connection_
router
.
routers
],
[
'TestRouter'
,
'WriteRouter'
])
[
'TestRouter'
,
'WriteRouter'
])
...
...
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