id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,000 | comment_view_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/comment_view_tests.py | import re
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.comments import signals
from django.contrib.comments.models import Comment
from regressiontests.comment_tests.models import Article, Book
from regressiontests.comment_tests.tests import CommentTestCase
post_redir... | 10,688 | Python | .py | 225 | 38.866667 | 90 | 0.649856 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,001 | templatetag_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/templatetag_tests.py | from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context
from regressiontests.comment_tests.models import Article, Author
from regressiontests.comment_tests.tests impo... | 4,541 | Python | .py | 76 | 52.210526 | 120 | 0.667417 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,002 | model_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/model_tests.py | from django.contrib.comments.models import Comment
from regressiontests.comment_tests.models import Author, Article
from regressiontests.comment_tests.tests import CommentTestCase
class CommentModelTests(CommentTestCase):
def testSave(self):
for c in self.createSomeComments():
self.assertNotE... | 1,924 | Python | .py | 41 | 39.097561 | 83 | 0.681067 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,003 | comment_utils_moderators_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py | from regressiontests.comment_tests.tests import CommentTestCase, CT, Site
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.comments.moderation import moderator, CommentModerator, AlreadyModerated
from regressiontests.comment_tests.models import... | 2,593 | Python | .py | 59 | 36.847458 | 92 | 0.713264 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,004 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/__init__.py | from django.contrib.auth.models import User
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase
from regressiontests.comment_tests... | 3,272 | Python | .py | 82 | 31.04878 | 80 | 0.611879 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,005 | comment_form_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/comment_form_tests.py | import time
from django.conf import settings
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.utils.hashcompat import sha_constructor
from regressiontests.comment_tests.models import Article
from regressiontests.comment_tests.tests import CommentTest... | 3,072 | Python | .py | 65 | 39.630769 | 84 | 0.692436 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,006 | moderation_view_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/moderation_view_tests.py | from django.contrib.auth.models import User, Permission
from django.contrib.comments import signals
from django.contrib.comments.models import Comment, CommentFlag
from django.contrib.contenttypes.models import ContentType
from regressiontests.comment_tests.tests import CommentTestCase
class FlagViewTests(CommentTes... | 8,582 | Python | .py | 167 | 42.964072 | 117 | 0.670844 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,007 | app_api_tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/tests/app_api_tests.py | from django.conf import settings
from django.contrib import comments
from django.contrib.comments.models import Comment
from django.contrib.comments.forms import CommentForm
from regressiontests.comment_tests.tests import CommentTestCase
class CommentAppAPITests(CommentTestCase):
"""Tests for the "comment app" API... | 2,600 | Python | .py | 53 | 41.981132 | 90 | 0.71728 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,008 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/custom_comments/__init__.py | from django.core import urlresolvers
from regressiontests.comment_tests.custom_comments.models import CustomComment
from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm
def get_model():
return CustomComment
def get_form():
return CustomCommentForm
def get_form_target():
ret... | 944 | Python | .py | 26 | 31.192308 | 86 | 0.746711 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,009 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/comment_tests/custom_comments/views.py | from django.http import HttpResponse
def custom_submit_comment(request):
return HttpResponse("Hello from the custom submit comment view.")
def custom_flag_comment(request, comment_id):
return HttpResponse("Hello from the custom flag view.")
def custom_delete_comment(request, comment_id):
return HttpRespo... | 475 | Python | .py | 9 | 49.555556 | 69 | 0.787879 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,010 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/model_formsets_regress/models.py | from django.db import models
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, to_field="username")
data = models.IntegerField()
class Place(models.Model):
name = models.Cha... | 741 | Python | .py | 21 | 31.238095 | 59 | 0.742978 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,011 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/model_formsets_regress/tests.py | from django import forms
from django.forms.util import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory
from django.test import TestCase
from models import User, UserSite, Restaurant, Manager, Network, Host
class InlineFormsetTests(TestCase):
def... | 10,381 | Python | .py | 239 | 33.192469 | 94 | 0.592538 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,012 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/sites_framework/models.py | from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.db import models
class AbstractArticle(models.Model):
title = models.CharField(max_length=50)
objects = models.Manager()
on_site = CurrentSiteManager()
class Meta:
abstract = ... | 996 | Python | .py | 25 | 35.52 | 69 | 0.772917 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,013 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/sites_framework/tests.py | from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
from models import SyndicatedArticle, ExclusiveArticle, CustomArticle, InvalidArticle, ConfusedArticle
class SitesFrameworkTestCase(TestCase):
def setUp(self):
Site.objects.get_or_create(id=setti... | 1,784 | Python | .py | 27 | 58 | 128 | 0.739232 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,014 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/models.py | """
Regression tests for Django built-in views.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
def get_absolute_url(self):
return '/views/authors/%s/' % self.id
class BaseArticle(models.Model):... | 1,202 | Python | .py | 38 | 26.763158 | 78 | 0.692108 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,015 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/urls.py | # coding: utf-8
from os import path
from django.conf.urls.defaults import *
from models import *
import views
base_dir = path.dirname(path.abspath(__file__))
media_dir = path.join(base_dir, 'media')
locale_dir = path.join(base_dir, 'locale')
js_info_dict = {
'domain': 'djangojs',
'packages': ('regressionte... | 5,284 | Python | .py | 109 | 43.458716 | 119 | 0.654206 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,016 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/__init__.py | # -*- coding: utf8 -*-
class BrokenException(Exception):
pass
except_args = ('Broken!', # plain exception with ASCII text
u'¡Broken!', # non-ASCII unicode data
'¡Broken!', # non-ASCII, utf-8 encoded bytestring
'\xa1Broken!', ) # non-ASCII... | 343 | Python | .py | 7 | 40.285714 | 73 | 0.543807 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,017 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/views.py | import sys
from django import forms
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import get_resolver
from django.shortcuts import render_to_response
from django.template import TemplateDoesNotExist
from django.views.debug import technical_500_response
from django.views.gener... | 2,055 | Python | .py | 52 | 34.365385 | 77 | 0.728234 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,018 | debugtags.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/templatetags/debugtags.py | from django import template
from regressiontests.views import BrokenException
register = template.Library()
@register.simple_tag
def go_boom(arg):
raise BrokenException(arg)
| 183 | Python | .py | 6 | 28 | 49 | 0.837209 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,019 | i18n.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/i18n.py | # -*- coding:utf-8 -*-
import gettext
from django.conf import settings
from django.test import TestCase
from django.utils.translation import activate, deactivate
from django.utils.text import javascript_quote
from regressiontests.views.urls import locale_dir
class I18NTests(TestCase):
""" Tests django views in d... | 6,328 | Python | .py | 128 | 41.195313 | 126 | 0.682046 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,020 | defaults.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/defaults.py | from os import path
from django.conf import settings
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from regressiontests.views.models import Author, Article, UrlArticle
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py"""
fixtures = [... | 3,922 | Python | .py | 72 | 44.597222 | 111 | 0.64712 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,021 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/__init__.py | from debug import *
from defaults import *
from generic.create_update import *
from generic.date_based import *
from i18n import *
from specials import *
from static import *
| 175 | Python | .py | 7 | 24 | 35 | 0.809524 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,022 | debug.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/debug.py | import inspect
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError
from regressiontests.views import BrokenException, except_args
class DebugViewTes... | 2,141 | Python | .py | 44 | 39.795455 | 119 | 0.668424 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,023 | static.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/static.py | import mimetypes
from os import path
from django.test import TestCase
from django.http import HttpResponseNotModified
from regressiontests.views.urls import media_dir
class StaticTests(TestCase):
"""Tests django views in django/views/static.py"""
def test_serve(self):
"The static view can serve stati... | 3,406 | Python | .py | 66 | 41.560606 | 105 | 0.638029 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,024 | specials.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/specials.py | # coding: utf-8
from django.test import TestCase
class URLHandling(TestCase):
"""
Tests for URL handling in views and responses.
"""
redirect_target = "/views/%E4%B8%AD%E6%96%87/target/"
def test_combining_redirect(self):
"""
Tests that redirecting to an IRI, requiring encoding bef... | 1,326 | Python | .py | 30 | 36.633333 | 77 | 0.682984 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,025 | date_based.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/generic/date_based.py | # coding: utf-8
from django.test import TestCase
from datetime import datetime, date
from datetime import timedelta
from regressiontests.views.models import Article, Author, DateArticle
class ObjectDetailTest(TestCase):
fixtures = ['testdata.json']
def setUp(self):
# Correct the date for the current ar... | 6,988 | Python | .py | 120 | 49.766667 | 117 | 0.680117 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,026 | create_update.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/views/tests/generic/create_update.py | import datetime
from django.test import TestCase
from django.core.exceptions import ImproperlyConfigured
from regressiontests.views.models import Article, UrlArticle
class CreateObjectTest(TestCase):
fixtures = ['testdata.json']
def test_login_required_view(self):
"""
Verifies that an unauth... | 8,270 | Python | .py | 181 | 36.662983 | 100 | 0.648343 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,027 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_widgets/models.py | from django.db import models
from django.contrib.auth.models import User
class MyFileField(models.FileField):
pass
class Member(models.Model):
name = models.CharField(max_length=100)
birthdate = models.DateTimeField(blank=True, null=True)
gender = models.CharField(max_length=1, blank=True, choices=[('... | 2,170 | Python | .py | 53 | 36.226415 | 96 | 0.714558 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,028 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_widgets/urls.py |
from django.conf.urls.defaults import *
import widgetadmin
urlpatterns = patterns('',
(r'^', include(widgetadmin.site.urls)),
)
| 134 | Python | .py | 5 | 24.6 | 43 | 0.748031 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,029 | widgetadmin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_widgets/widgetadmin.py | """
"""
from django.contrib import admin
import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs)... | 834 | Python | .py | 22 | 33.818182 | 94 | 0.728856 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,030 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_widgets/tests.py | # encoding: utf-8
from datetime import datetime
from unittest import TestCase
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.widgets import FilteredSelectMultiple, AdminSplitDateTime
from django.contrib.admi... | 15,241 | Python | .py | 262 | 48.965649 | 455 | 0.66255 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,031 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/modeladmin/models.py | # coding: utf-8
from datetime import date
from django.db import models
from django.contrib.auth.models import User
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
def __unicode__(self):
return self.name
class Conce... | 1,183 | Python | .py | 30 | 34.5 | 94 | 0.696413 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,032 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/modeladmin/tests.py | from datetime import date
import unittest
from django import forms
from django.conf import settings
from django.contrib.admin.options import ModelAdmin, TabularInline, \
HORIZONTAL, VERTICAL
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.validation import validate
from django.contrib.ad... | 41,732 | Python | .py | 943 | 32.883351 | 186 | 0.630944 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,033 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/bug8245/tests.py | from unittest import TestCase
from django.contrib import admin
class Bug8245Test(TestCase):
"""
Test for bug #8245 - don't raise an AlreadyRegistered exception when using
autodiscover() and an admin.py module contains an error.
"""
def test_bug_8245(self):
# The first time autodiscover is... | 991 | Python | .py | 25 | 30.64 | 78 | 0.633056 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,034 | admin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/bug8245/admin.py | from django.contrib import admin
from models import Story
admin.site.register(Story)
raise Exception("Bad admin module")
| 124 | Python | .py | 4 | 29.25 | 35 | 0.846154 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,035 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/null_fk_ordering/models.py | """
Regression tests for proper working of ForeignKey(null=True). Tests these bugs:
* #7512: including a nullable foreign key reference in Meta ordering has un
xpected results
"""
from django.db import models
# The first two models represent a very simple null FK ordering case.
class Author(models.Model):
n... | 1,357 | Python | .py | 34 | 35.411765 | 79 | 0.720948 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,036 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/null_fk_ordering/tests.py | from django.test import TestCase
from regressiontests.null_fk_ordering.models import *
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys shouldn't exclude results
"""
author_1 =... | 2,012 | Python | .py | 32 | 54.53125 | 102 | 0.692347 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,037 | datastructures.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/datastructures.py | """
Tests for stuff in django.utils.datastructures.
"""
import pickle
import unittest
from django.utils.datastructures import *
class DatastructuresTestCase(unittest.TestCase):
def assertRaisesErrorWithMessage(self, error, message, callable,
*args, **kwargs):
self.assertRaises(error, callable, *a... | 9,010 | Python | .py | 192 | 36.619792 | 83 | 0.5626 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,038 | datetime_safe.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/datetime_safe.py | import unittest
from datetime import date as original_date, datetime as original_datetime
from django.utils.datetime_safe import date, datetime
class DatetimeTests(unittest.TestCase):
def setUp(self):
self.just_safe = (1900, 1, 1)
self.just_unsafe = (1899, 12, 31, 23, 59, 59)
self.really_... | 2,087 | Python | .py | 31 | 59.516129 | 132 | 0.651345 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,039 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/urls.py | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
(r'^xview/$', views.xview),
(r'^class_xview/$', views.class_xview),
)
| 160 | Python | .py | 6 | 24 | 43 | 0.684211 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,040 | feedgenerator.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/feedgenerator.py | import datetime
import unittest
from django.utils import feedgenerator, tzinfo
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
"""
Test get_tag_uri() correctly generates TagURIs.
"""
se... | 2,217 | Python | .py | 54 | 32.259259 | 143 | 0.623491 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,041 | text.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/text.py | import unittest
from django.utils import text
class TestUtilsText(unittest.TestCase):
def test_truncate_words(self):
self.assertEqual(u'The quick brown fox jumped over the lazy dog.',
text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10))
self.assertEqual(u'The quic... | 1,440 | Python | .py | 18 | 70.888889 | 130 | 0.638028 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,042 | html.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/html.py | import unittest
from django.utils import html
class TestUtilsHtml(unittest.TestCase):
def check_output(self, function, value, output=None):
"""
Check that function(value) equals output. If output is None,
check that function(value) equals value.
"""
if output is None:
... | 4,753 | Python | .py | 113 | 31.628319 | 127 | 0.502376 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,043 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/tests.py | """
Tests for django.utils.
"""
from dateformat import *
from feedgenerator import *
from module_loading import *
from termcolors import *
from html import *
from checksums import *
from text import *
from simplelazyobject import *
from decorators import *
from functional import *
from timesince import *
from datastru... | 385 | Python | .py | 17 | 21.588235 | 30 | 0.814714 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,044 | checksums.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/checksums.py | import unittest
from django.utils import checksums
class TestUtilsChecksums(unittest.TestCase):
def check_output(self, function, value, output=None):
"""
Check that function(value) equals output. If output is None,
check that function(value) equals value.
"""
if output is... | 1,098 | Python | .py | 25 | 34.44 | 78 | 0.60898 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,045 | timesince.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/timesince.py | import datetime
import unittest
from django.utils.timesince import timesince, timeuntil
from django.utils.tzinfo import LocalTimezone, FixedOffset
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, 8, 14, 13, 46, 0)
self.onemicrosecond = datetime.timedelta(... | 4,590 | Python | .py | 94 | 39.56383 | 76 | 0.647334 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,046 | tzinfo.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/tzinfo.py | import unittest
from django.utils.tzinfo import FixedOffset
class TzinfoTests(unittest.TestCase):
def test_fixedoffset(self):
self.assertEquals(repr(FixedOffset(0)), '+0000')
self.assertEquals(repr(FixedOffset(60)), '+0100')
self.assertEquals(repr(FixedOffset(-60)), '-0100')
self.... | 795 | Python | .py | 15 | 45.666667 | 62 | 0.671815 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,047 | simplelazyobject.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/simplelazyobject.py | import unittest
import django.utils.copycompat as copy
from django.utils.functional import SimpleLazyObject
class _ComplexObject(object):
def __init__(self, name):
self.name = name
def __eq__(self, other):
return self.name == other.name
def __hash__(self):
return hash(self.name)
... | 2,618 | Python | .py | 59 | 36.881356 | 93 | 0.671389 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,048 | functional.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/functional.py | import unittest
from django.utils.functional import lazy
class FunctionalTestCase(unittest.TestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
for a, b in zip(t(), range(3)):
self.assertEqual(a, b)
| 260 | Python | .py | 7 | 31.142857 | 54 | 0.672 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,049 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/decorators.py | from django.test import TestCase
class DecoratorFromMiddlewareTests(TestCase):
"""
Tests for view decorators created using
``django.utils.decorators.decorator_from_middleware``.
"""
def test_process_view_middleware(self):
"""
Test a middleware that implements process_view.
... | 577 | Python | .py | 16 | 29.375 | 86 | 0.672043 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,050 | module_loading.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/module_loading.py | import os
import sys
import unittest
from zipimport import zipimporter
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
class DefaultLoader(unittest.TestCase):
def test_loader(self):
"Normal module existence can be tested"
test_module = ... | 4,790 | Python | .py | 95 | 42.736842 | 105 | 0.687928 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,051 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/views.py | from django.http import HttpResponse
from django.utils.decorators import decorator_from_middleware
from django.middleware.doc import XViewMiddleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
xview = xview_dec(xview)
class ClassXView(object):
def __call... | 408 | Python | .py | 11 | 34.090909 | 61 | 0.797954 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,052 | termcolors.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/termcolors.py | import unittest
from django.utils.termcolors import parse_color_setting, PALETTES, DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEquals(parse_color_setting(''), PALETTES[DEFAULT_PALETTE])
def test_simple... | 7,392 | Python | .py | 125 | 41.64 | 128 | 0.543421 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,053 | dateformat.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/utils/dateformat.py | from datetime import datetime, date
import os
import time
import unittest
from django.utils.dateformat import format
from django.utils import dateformat, translation
from django.utils.tzinfo import FixedOffset, LocalTimezone
class DateFormatTests(unittest.TestCase):
def setUp(self):
self.old_TZ = os.envir... | 5,828 | Python | .py | 105 | 46.733333 | 112 | 0.64678 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,054 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/file_uploads/models.py | import tempfile
import os
from django.db import models
from django.core.files.storage import FileSystemStorage
temp_storage = FileSystemStorage(tempfile.mkdtemp())
UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
class FileModel(models.Model):
testfile = models.FileField(storage=temp_storage, upload... | 339 | Python | .py | 8 | 40.625 | 78 | 0.817629 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,055 | uploadhandler.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/file_uploads/uploadhandler.py | """
Upload handlers to test the upload API.
"""
from django.core.files.uploadhandler import FileUploadHandler, StopUpload
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the connection if more than a quota
(5MB) is uploaded.
"""
QUOTA = 5 * 2**20 # 5 MB
... | 978 | Python | .py | 26 | 30.923077 | 75 | 0.694323 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,056 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/file_uploads/urls.py | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
(r'^upload/$', views.file_upload_view),
(r'^verify/$', views.file_upload_view_verify),
(r'^unicode_name/$', views.file_upload_unicode_name),
(r'^echo/$', views.file_upload_echo),
(r'^quot... | 542 | Python | .py | 12 | 41.416667 | 61 | 0.604915 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,057 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/file_uploads/tests.py | #! -*- coding: utf-8 -*-
import errno
import os
import shutil
import unittest
from StringIO import StringIO
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, client
from django.utils import simplejson
from django.utils.hashcom... | 11,555 | Python | .py | 261 | 34.153257 | 110 | 0.58779 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,058 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/file_uploads/views.py | import os
from django.core.files.uploadedfile import UploadedFile
from django.http import HttpResponse, HttpResponseServerError
from django.utils import simplejson
from models import FileModel, UPLOAD_TO
from uploadhandler import QuotaUploadHandler, ErroringUploadHandler
from django.utils.hashcompat import sha_construc... | 3,859 | Python | .py | 97 | 34.113402 | 104 | 0.702003 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,059 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/inline_formsets/models.py | # coding: utf-8
from django.db import models
class School(models.Model):
name = models.CharField(max_length=100)
class Parent(models.Model):
name = models.CharField(max_length=100)
class Child(models.Model):
mother = models.ForeignKey(Parent, related_name='mothers_children')
father = models.ForeignK... | 730 | Python | .py | 20 | 32.1 | 71 | 0.726496 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,060 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/inline_formsets/tests.py | from django.forms.models import inlineformset_factory
from django.test import TestCase
from regressiontests.inline_formsets.models import Poet, Poem, School, Parent, Child
class DeletionTests(TestCase):
def test_deletion(self):
PoemFormSet = inlineformset_factory(Poet, Poem, can_delete=True)
poe... | 6,432 | Python | .py | 146 | 34.5 | 155 | 0.61525 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,061 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/initial_sql_regress/models.py | """
Regression tests for initial SQL insertion.
"""
from django.db import models
class Simple(models.Model):
name = models.CharField(max_length = 50)
| 157 | Python | .py | 6 | 24 | 44 | 0.763514 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,062 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/initial_sql_regress/tests.py | from django.test import TestCase
from models import Simple
class InitialSQLTests(TestCase):
def test_initial_sql(self):
# The format of the included SQL file for this test suite is important.
# It must end with a trailing newline in order to test the fix for #2161.
# However, as pointed ... | 591 | Python | .py | 11 | 46.909091 | 81 | 0.710069 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,063 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/db_typecasts/tests.py | # Unit tests for typecast functions in django.db.backends.util
from django.db.backends import util as typecasts
import datetime, unittest
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),
('1990-01-01', datetime.date(1990, 1, 1)... | 2,547 | Python | .py | 58 | 36.155172 | 112 | 0.545272 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,064 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/humanize/tests.py | import unittest
from datetime import timedelta, date
from django.template import Template, Context, add_to_builtins
from django.utils.dateformat import DateFormat
from django.utils.translation import ugettext as _
from django.utils.html import escape
add_to_builtins('django.contrib.humanize.templatetags.humanize')
cl... | 3,296 | Python | .py | 61 | 42.606557 | 127 | 0.57764 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,065 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/model_inheritance_select_related/models.py | """
Regression tests for the interaction between model inheritance and
select_related().
"""
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
class Meta:
ordering = ('name',)
def __unicode__(self):
return u"%s the place" % self.name
class Re... | 676 | Python | .py | 21 | 27.571429 | 66 | 0.695518 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,066 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/model_inheritance_select_related/tests.py | from operator import attrgetter
from django.test import TestCase
from models import Restaurant, Person
class ModelInheritanceSelectRelatedTests(TestCase):
def test_inherited_select_related(self):
# Regression test for #7246
r1 = Restaurant.objects.create(
name="Nobu", serves_sushi=Tr... | 968 | Python | .py | 23 | 32.826087 | 87 | 0.643237 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,067 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/middleware/urls.py | from django.conf.urls.defaults import patterns
urlpatterns = patterns('',
(r'^noslash$', 'view'),
(r'^slash/$', 'view'),
(r'^needsquoting#/$', 'view'),
)
| 167 | Python | .py | 6 | 24.666667 | 46 | 0.6125 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,068 | extra_urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/middleware/extra_urls.py | from django.conf.urls.defaults import patterns
urlpatterns = patterns('',
(r'^middleware/customurlconf/noslash$', 'view'),
(r'^middleware/customurlconf/slash/$', 'view'),
(r'^middleware/customurlconf/needsquoting#/$', 'view'),
)
| 242 | Python | .py | 6 | 37.166667 | 59 | 0.710638 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,069 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/middleware/tests.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpRequest
from django.middleware.common import CommonMiddleware
from django.test import TestCase
class CommonMiddlewareTest(TestCase):
def setUp(self):
self.slash = settings.APPEND_SLASH
self.www = settings.PREPEND... | 9,775 | Python | .py | 222 | 35.72973 | 91 | 0.668276 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,070 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/pagination_regress/tests.py | from unittest import TestCase
from django.core.paginator import Paginator, EmptyPage
class PaginatorTests(TestCase):
"""
Tests for the Paginator and Page classes.
"""
def check_paginator(self, params, output):
"""
Helper method that instantiates a Paginator object from the passed
... | 7,318 | Python | .py | 150 | 37.666667 | 84 | 0.472699 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,071 | filters.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/filters.py | # coding: utf-8
"""
Tests for template filters (as opposed to template tags).
The tests are hidden inside a function so that things like timestamps and
timezones are only evaluated at the moment of execution and will therefore be
consistent.
"""
from datetime import date, datetime, timedelta
from django.utils.tzinfo... | 29,631 | Python | .py | 279 | 97.422939 | 392 | 0.523213 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,072 | context.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/context.py | # coding: utf-8
from unittest import TestCase
from django.template import Context
class ContextTests(TestCase):
def test_context(self):
c = Context({"a": 1, "b": "xyzzy"})
self.assertEqual(c["a"], 1)
self.assertEqual(c.push(), {})
c["a"] = 2
self.assertEqual(c["a"], 2)
... | 484 | Python | .py | 14 | 27.928571 | 46 | 0.5803 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,073 | unicode.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/unicode.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from django.template import Template, TemplateEncodingError, Context
from django.utils.safestring import SafeData
class UnicodeTests(TestCase):
def test_template(self):
# Templates can be created from unicode strings.
t1 = Template(u'ŠĐĆŽćžšđ ... | 1,290 | Python | .py | 25 | 43.76 | 88 | 0.66 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,074 | nodelist.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/nodelist.py | from unittest import TestCase
from django.template.loader import get_template_from_string
from django.template import VariableNode
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_template_from_string(source)
vars = template.n... | 1,121 | Python | .py | 24 | 39.458333 | 64 | 0.649863 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,075 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/urls.py | # coding: utf-8
from django.conf.urls.defaults import *
from regressiontests.templates import views
urlpatterns = patterns('',
# Test urls for testing reverse lookups
(r'^$', views.index),
(r'^client/([\d,]+)/$', views.client),
(r'^client/(?P<id>\d+)/(?P<action>[^/]+)/$', views.client_action),
(r'... | 730 | Python | .py | 14 | 45.5 | 106 | 0.641902 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,076 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/tests.py | # -*- coding: utf-8 -*-
from django.conf import settings
if __name__ == '__main__':
# When running this file in isolation, we need to set up the configuration
# before importing 'template'.
settings.configure()
from datetime import datetime, timedelta
import time
import os
import sys
import traceback
impo... | 91,886 | Python | .py | 1,134 | 67.928571 | 388 | 0.521334 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,077 | loaders.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/loaders.py | """
Test cases for the template loaders
Note: This test requires setuptools!
"""
from django.conf import settings
if __name__ == '__main__':
settings.configure()
import unittest
import sys
import pkg_resources
import imp
import StringIO
import os.path
import warnings
from django.template import TemplateDoesNot... | 5,466 | Python | .py | 121 | 38.280992 | 119 | 0.682092 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,078 | smartif.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/smartif.py | import unittest
from django.template.smartif import IfParser, Literal
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many other test... | 2,175 | Python | .py | 41 | 44.804878 | 91 | 0.590009 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,079 | custom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/custom.py | from unittest import TestCase
from django import template
class CustomTests(TestCase):
def test_filter(self):
t = template.Template("{% load custom %}{{ string|trim:5 }}")
self.assertEqual(
t.render(template.Context({"string": "abcdefghijklmnopqrstuvwxyz"})),
u"abcde"
... | 326 | Python | .py | 9 | 29.111111 | 81 | 0.649682 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,080 | parser.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/parser.py | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from unittest import TestCase
from django.template import (TokenParser, FilterExpression, Parser, Variable,
TemplateSyntaxError)
class ParserTests(TestCase):
def test_token_parsing(self):
# ... | 3,185 | Python | .py | 69 | 37.57971 | 102 | 0.620445 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,081 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/views.py | # Fake views for testing url reverse lookup
def index(request):
pass
def client(request, id):
pass
def client_action(request, id, action):
pass
def client2(request, tag):
pass
| 196 | Python | .py | 9 | 18.555556 | 43 | 0.73224 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,082 | custom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/templatetags/custom.py | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
def trim(value, num):
return value[:num]
trim = stringfilter(trim)
register.filter(trim)
| 211 | Python | .py | 7 | 28 | 55 | 0.82 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,083 | bad_tag.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/templatetags/bad_tag.py | from django import template
register = template.Library()
@register.tag
def badtag(parser, token):
raise RuntimeError("I am a bad tag")
| 142 | Python | .py | 5 | 26.2 | 40 | 0.777778 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,084 | customadmin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_views/customadmin.py | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from django.conf.urls.defaults import patterns
from django.contrib import admin
from django.http import HttpResponse
import models
class Admin2(admin.AdminSite):
login_template = 'custom_admin/login.html'
logout_template = 'custom_admin/log... | 1,158 | Python | .py | 27 | 38.666667 | 76 | 0.733096 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,085 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_views/models.py | # -*- coding: utf-8 -*-
import datetime
import tempfile
import os
from django.contrib import admin
from django.core.files.storage import FileSystemStorage
from django.contrib.admin.views.main import ChangeList
from django.core.mail import EmailMessage
from django.db import models
from django import forms
from django.f... | 20,354 | Python | .py | 535 | 32.859813 | 93 | 0.712309 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,086 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_views/urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
import views
import customadmin
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/secure-view/$', views.secure_view),
(r'^admin/', include(admin.site.urls)),
(r'^admin2/', include(cus... | 344 | Python | .py | 10 | 31.7 | 63 | 0.717718 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,087 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_views/tests.py | # coding: utf-8
import re
import datetime
import urlparse
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.core.files import temp as tempfile
from django.core.urlresolvers import reverse
# Register auth models with the admin.
from django.contrib.auth import REDIRECT_... | 111,514 | Python | .py | 2,148 | 41.986965 | 187 | 0.629561 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,088 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_views/views.py | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
def secure_view(request):
return HttpResponse('%s' % request.POST)
secure_view = staff_member_required(secure_view) | 229 | Python | .py | 5 | 44 | 71 | 0.816964 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,089 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/queries/models.py | """
Various complex queries that have been problematic in the past.
"""
import threading
from django.db import models
class DumbCategory(models.Model):
pass
class NamedCategory(DumbCategory):
name = models.CharField(max_length=10)
class Tag(models.Model):
name = models.CharField(max_length=10)
pare... | 7,747 | Python | .py | 214 | 31.154206 | 83 | 0.696953 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,090 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/queries/tests.py | import datetime
import pickle
import sys
import unittest
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS
from django.db.models import Count
from django.db.models.query import Q, ITER_CHUNK_SIZE, EmptyQuerySet
... | 67,172 | Python | .py | 1,432 | 37.159218 | 159 | 0.601877 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,091 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/special_headers/urls.py | # coding: utf-8
from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail
from models import Article
import views
urlpatterns = patterns('',
(r'^article/(?P<object_id>\d+)/$', object_detail, {'queryset': Article.objects.all()}),
(r'^xview/$', views.xview),
)
| 309 | Python | .py | 9 | 32.333333 | 91 | 0.722408 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,092 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/special_headers/tests.py | from django.test import TestCase
from django.contrib.auth.models import User
class SpecialHeadersTest(TestCase):
fixtures = ['data.xml']
def test_xheaders(self):
user = User.objects.get(username='super')
response = self.client.get('/special_headers/article/1/')
# import pdb; pdb.set_tr... | 1,659 | Python | .py | 37 | 36.72973 | 65 | 0.648548 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,093 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/special_headers/views.py | # -*- coding:utf-8 -*-
from django.http import HttpResponse
from django.utils.decorators import decorator_from_middleware
from django.middleware.doc import XViewMiddleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
xview = xview_dec(xview)
| 300 | Python | .py | 8 | 35.75 | 61 | 0.817241 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,094 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/models.py | # -*- coding: utf-8 -*-
import datetime
import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
temp_storage_location = tempfile.mkdtemp()
temp_storage = FileSystemStorage(location=temp_storage_location)
class BoundaryModel(models.Model):
positive_integer = models.P... | 2,477 | Python | .py | 49 | 43.387755 | 110 | 0.716604 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,095 | localflavortests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavortests.py | from localflavor.ar import ARLocalFlavorTests
from localflavor.at import ATLocalFlavorTests
from localflavor.au import AULocalFlavorTests
from localflavor.at import ATLocalFlavorTests
from localflavor.br import BRLocalFlavorTests
from localflavor.ca import CALocalFlavorTests
from localflavor.ch import CHLocalFlavorTest... | 1,392 | Python | .py | 30 | 45.366667 | 55 | 0.911095 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,096 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/models.py | # -*- coding: utf-8 -*-
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.conf import settings
from django.db import connection
from django.forms import Form, ModelForm, FileField, ModelChoiceField
from django.test import TestCase
from regressiontests.forms.models import ChoiceMo... | 9,207 | Python | .py | 145 | 56.427586 | 187 | 0.687067 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,097 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/util.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.forms.util import *
from django.utils.translation import ugettext_lazy
class FormsUtilTestCase(TestCase):
# Tests for forms/util.py module.
def test_flatatt(self):
###########
... | 2,617 | Python | .py | 44 | 48.227273 | 148 | 0.581704 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,098 | input_formats.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/input_formats.py | from datetime import time, date, datetime
from unittest import TestCase
from django import forms
from django.conf import settings
from django.utils.translation import activate, deactivate
class LocalizedTimeTests(TestCase):
def setUp(self):
self.old_TIME_INPUT_FORMATS = settings.TIME_INPUT_FORMATS
... | 38,962 | Python | .py | 687 | 47.85444 | 107 | 0.660108 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,099 | error_messages.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/error_messages.py | # -*- coding: utf-8 -*-
import unittest
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.test import TestCase
from django.utils.safestring import mark_safe
class AssertFormErrorsMixin(object):
def assertFormErrors(self, expected, the_callable, *args, **kwargs):
... | 10,666 | Python | .py | 224 | 37.861607 | 119 | 0.589936 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |