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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,000 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/localflavor/us/forms.py | from django.forms import ModelForm
from models import USPlace
class USPlaceForm(ModelForm):
"""docstring for PlaceForm"""
class Meta:
model = USPlace
| 167 | Python | .py | 6 | 24 | 34 | 0.75 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,001 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/formwizard/urls.py | from django.conf.urls.defaults import *
from forms import ContactWizard, Page1, Page2, Page3
urlpatterns = patterns('',
url(r'^wiz/$', ContactWizard([Page1, Page2, Page3])),
)
| 185 | Python | .py | 5 | 34.2 | 57 | 0.72067 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,002 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/formwizard/tests.py | import re
from django import forms
from django.test import TestCase
class FormWizardWithNullBooleanField(TestCase):
urls = 'regressiontests.formwizard.urls'
input_re = re.compile('name="([^"]+)" value="([^"]+)"')
wizard_url = '/wiz/'
wizard_step_data = (
{
'0-name': 'Pony',
... | 1,813 | Python | .py | 48 | 28.708333 | 88 | 0.596532 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,003 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/formwizard/forms.py | from django import forms
from django.contrib.formtools.wizard import FormWizard
from django.http import HttpResponse
class Page1(forms.Form):
name = forms.CharField(max_length=100)
thirsty = forms.NullBooleanField()
class Page2(forms.Form):
address1 = forms.CharField(max_length=100)
address2 = forms.C... | 535 | Python | .py | 14 | 34.071429 | 54 | 0.770138 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,004 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/reverse_single_related/models.py | from django.db import models
class SourceManager(models.Manager):
def get_query_set(self):
return super(SourceManager, self).get_query_set().filter(is_public=True)
class Source(models.Model):
is_public = models.BooleanField()
objects = SourceManager()
class Item(models.Model):
source = models... | 340 | Python | .py | 9 | 33.777778 | 80 | 0.75 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,005 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/reverse_single_related/tests.py | from django.test import TestCase
from regressiontests.reverse_single_related.models import *
class ReverseSingleRelatedTests(TestCase):
"""
Regression tests for an object that cannot access a single related
object due to a restrictive default manager.
"""
def test_reverse_single_related(self):
... | 1,477 | Python | .py | 27 | 46.407407 | 88 | 0.70229 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,006 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/backends/models.py | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db import connection
class Square(models.Model):
root = models.IntegerField()
square = models.PositiveIntegerField()
def __unicode__(self):
return "%... | 2,436 | Python | .py | 51 | 42.294118 | 115 | 0.733615 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,007 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/backends/tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
import datetime
from django.core.management.color import no_style
from django.db import backend, connection, connections, DEFAULT_DB_ALIAS, IntegrityError
from django.db.backends.signals import connection_created
from django.db.backends.postgr... | 12,550 | Python | .py | 235 | 45.123404 | 165 | 0.670169 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,008 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/test_client_regress/models.py | # -*- coding: utf-8 -*-
"""
Regression tests for the Test Client, especially the customized assertions.
"""
import os
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse
from django.template import (TemplateDoesNotExist, TemplateSyntaxErr... | 43,253 | Python | .py | 767 | 46.735332 | 180 | 0.657948 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,009 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/test_client_regress/urls.py | from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
import views
urlpatterns = patterns('',
(r'^no_template_view/$', views.no_template_view),
(r'^staff_only/$', views.staff_only_view),
(r'^get_view/$', views.get_view),
(r'^request_data/$', views.request_data),
... | 2,013 | Python | .py | 30 | 62.733333 | 120 | 0.662967 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,010 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/test_client_regress/views.py | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import SuspiciousOperation
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.utils.encoding impo... | 4,115 | Python | .py | 86 | 42.337209 | 99 | 0.723897 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,011 | session.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/test_client_regress/session.py | from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
"""
A simple cookie-based session storage implemenation.
The session key is actually the session data, pickled and encoded.
This means that saving the session will change the session key.
"""
def __i... | 861 | Python | .py | 23 | 30.26087 | 70 | 0.658654 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,012 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/custom_managers_regress/models.py | """
Regression tests for custom manager classes.
"""
from django.db import models
class RestrictedManager(models.Manager):
"""
A manager that filters out non-public instances.
"""
def get_query_set(self):
return super(RestrictedManager, self).get_query_set().filter(is_public=True)
class Relat... | 1,056 | Python | .py | 30 | 30.4 | 84 | 0.723425 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,013 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/custom_managers_regress/tests.py | from django.test import TestCase
from models import RelatedModel, RestrictedModel, OneToOneRestrictedModel
class CustomManagersRegressTestCase(TestCase):
def test_filtered_default_manager(self):
"""Even though the default manager filters out some records,
we must still be able to save (particularl... | 2,170 | Python | .py | 38 | 48.710526 | 88 | 0.693829 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,014 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/get_or_create_regress/models.py | from django.db import models
class Publisher(models.Model):
name = models.CharField(max_length=100)
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
name = models.CharField(max_length=100)
authors = models.ManyToManyField(Author, related_name='books')
... | 417 | Python | .py | 9 | 42.666667 | 99 | 0.764851 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,015 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/get_or_create_regress/tests.py | from django.test import TestCase
from models import Author, Publisher
class GetOrCreateTests(TestCase):
def test_related(self):
p = Publisher.objects.create(name="Acme Publishing")
# Create a book through the publisher.
book, created = p.books.get_or_create(name="The Book of Ed & Fred")
... | 2,540 | Python | .py | 49 | 43.102041 | 91 | 0.659128 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,016 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/datatypes/models.py | """
This is a basic model to test saving and loading boolean and date-related
types, which in the past were problematic for some database backends.
"""
from django.db import models
class Donut(models.Model):
name = models.CharField(max_length=100)
is_frosted = models.BooleanField(default=False)
has_sprink... | 771 | Python | .py | 20 | 34.3 | 73 | 0.733244 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,017 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/datatypes/tests.py | import datetime
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.test import TestCase, skipIfDBFeature
from django.utils import tzinfo
from models import Donut, RumBaba
class DataTypesTestCase(TestCase):
def test_boolean_type(self):
d = Donut(name='Apple Fritter')
... | 4,250 | Python | .py | 75 | 47.786667 | 116 | 0.6718 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,018 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/defaultfilters/tests.py | # -*- coding: utf-8 -*-
import datetime
from django.utils import unittest
from django.template.defaultfilters import *
class DefaultFiltersTests(unittest.TestCase):
def test_floatformat(self):
self.assertEqual(floatformat(7.7), u'7.7')
self.assertEqual(floatformat(7.0), u'7')
self.assertE... | 24,500 | Python | .py | 447 | 43.310962 | 87 | 0.579852 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,019 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_regress/models.py | # coding: utf-8
from django.db import models
CHOICES = (
(1, 'first'),
(2, 'second'),
)
class Article(models.Model):
headline = models.CharField(max_length=100, default='Default headline')
pub_date = models.DateTimeField()
status = models.IntegerField(blank=True, null=True, choices=CHOICES)
m... | 1,683 | Python | .py | 44 | 33.113636 | 76 | 0.701419 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,020 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_regress/tests.py | import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.test import TestCase, skipUnlessDBFeature
from django.utils import tzinfo
from models import (Worker, Article, Party, Event, Department,
BrokenUnicodeMethod, NonAutoPK)
class ModelTests(TestCase):
... | 6,565 | Python | .py | 153 | 33.27451 | 84 | 0.615637 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,021 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/cache/models.py | from django.db import models
from datetime import datetime
def expensive_calculation():
expensive_calculation.num_runs += 1
return datetime.now()
class Poll(models.Model):
question = models.CharField(max_length=200)
answer = models.CharField(max_length=200)
pub_date = models.DateTimeField('date pu... | 361 | Python | .py | 9 | 36.666667 | 84 | 0.777143 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,022 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/cache/tests.py | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import os
import tempfile
import time
import warnings
from django.conf import settings
from django.core import management
from django.core.cache import get_cache, DEFAULT_CACHE_ALIAS
from django.c... | 64,411 | Python | .py | 1,191 | 45.025189 | 190 | 0.658256 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,023 | liberal_backend.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/cache/liberal_backend.py | from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
| 215 | Python | .py | 6 | 31.666667 | 57 | 0.805825 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,024 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/requests/tests.py | import time
from datetime import datetime, timedelta
from StringIO import StringIO
from django.core.handlers.modpython import ModPythonRequest
from django.core.handlers.wsgi import WSGIRequest, LimitedStream
from django.http import HttpRequest, HttpResponse, parse_cookie
from django.utils import unittest
from django.u... | 8,301 | Python | .py | 161 | 42.981366 | 117 | 0.654552 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,025 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/many_to_one_regress/models.py | """
Regression tests for a few ForeignKey bugs.
"""
from django.db import models
# If ticket #1578 ever slips back in, these models will not be able to be
# created (the field names being lower-cased versions of their opposite
# classes is important here).
class First(models.Model):
second = models.IntegerField(... | 1,396 | Python | .py | 33 | 38.727273 | 80 | 0.732593 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,026 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/many_to_one_regress/tests.py | from django.db import models
from django.test import TestCase
from models import First, Second, Third, Parent, Child, Category, Record, Relation
class ManyToOneRegressionTests(TestCase):
def test_object_creation(self):
Third.objects.create(id='3', name='An example')
parent = Parent(name='fred')
... | 4,466 | Python | .py | 83 | 45.120482 | 110 | 0.665902 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,027 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/text/tests.py | # coding: utf-8
from django.test import TestCase
from django.utils.text import *
from django.utils.http import urlquote, urlquote_plus, cookie_date, http_date
from django.utils.encoding import iri_to_uri
from django.utils.translation import activate, deactivate
class TextTests(TestCase):
"""
Tests for stuff i... | 3,699 | Python | .py | 68 | 45.294118 | 92 | 0.605438 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,028 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/app_loading/tests.py | import copy
import os
import sys
import time
from django.conf import Settings
from django.db.models.loading import cache, load_app
from django.utils.unittest import TestCase
class InstalledAppsGlobbingTest(TestCase):
def setUp(self):
self.OLD_SYS_PATH = sys.path[:]
sys.path.append(os.path.dirname... | 3,019 | Python | .py | 68 | 36.470588 | 104 | 0.643733 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,029 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_relations_regress/models.py | from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
__all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address',
'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2',
'Contact', 'Organization', 'Note')
clas... | 2,612 | Python | .py | 61 | 38.04918 | 82 | 0.727596 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,030 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_relations_regress/tests.py | from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from models import *
class GenericRelationTests(TestCase):
def test_inherited_models_content_type(self):
"""
Test that GenericRelations on inherited classes use the correct co... | 2,909 | Python | .py | 60 | 38.883333 | 79 | 0.647972 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,031 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/httpwrappers/tests.py | import copy
import pickle
from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
parse_cookie)
from django.utils import unittest
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
self.assertRaises(KeyError, q.__getitem__, 'foo')... | 11,505 | Python | .py | 238 | 39.655462 | 99 | 0.602834 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,032 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/models.py | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class TestModel(models.Model):
text = models.CharField(max_length=10, default=_('Anything'))
class Company(models.Model):
name = models.CharField(max_length=50)
date_added = models.DateTimeFi... | 481 | Python | .py | 10 | 44.9 | 77 | 0.773987 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,033 | test_warnings.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/test_warnings.py | from os.path import join, normpath, abspath, dirname
import warnings
import django
from django.conf import settings
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils.translation import _trans
from django.utils.unittest import TestCase
class DeprecationWarningTests(TestCase):
... | 2,180 | Python | .py | 37 | 50.810811 | 165 | 0.713951 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,034 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/tests.py | # -*- encoding: utf-8 -*-
import datetime
import decimal
import os
import sys
import pickle
from threading import local
from django.conf import settings
from django.template import Template, Context
from django.utils.formats import (get_format, date_format, time_format,
localize, localize_input, iter_format_module... | 48,435 | Python | .py | 782 | 51.772379 | 2,355 | 0.624648 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,035 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/forms.py | from django import template, forms
from django.forms.extras import SelectDateWidget
from models import Company
class I18nForm(forms.Form):
decimal_field = forms.DecimalField(localize=True)
float_field = forms.FloatField(localize=True)
date_field = forms.DateField(localize=True)
datetime_field = forms.D... | 816 | Python | .py | 18 | 41.222222 | 83 | 0.782116 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,036 | compilation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/compilation.py | import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.management import CommandError
from django.core.management.commands.compilemessages import compile_messages
from django.test import TestCase
LOCALE='es_AR'
class MessageCompilationTests(TestCase)... | 1,032 | Python | .py | 25 | 35.72 | 80 | 0.732197 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,037 | extraction.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/extraction.py | import os
import re
import shutil
from django.test import TestCase
from django.core import management
LOCALE='de'
class ExtractorTests(TestCase):
PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE
def setUp(self):
self._cwd = os.getcwd()
self.test_dir = os.path.abspath(os.path.dirname(__file... | 7,319 | Python | .py | 130 | 47.546154 | 174 | 0.671886 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,038 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/__init__.py | from django.utils.translation import ugettext as _
# Translators: This comment should be extracted
dummy1 = _("This is a translatable string.")
# This comment should not be extracted
dummy2 = _("This is another translatable string.")
| 237 | Python | .py | 5 | 45.8 | 50 | 0.786026 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,039 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/i18n/commands/tests.py | import os
import re
from subprocess import Popen, PIPE
def find_command(cmd, path=None, pathext=None):
if path is None:
path = os.environ.get('PATH', []).split(os.pathsep)
if isinstance(path, basestring):
path = [path]
# check if there are funny path extensions for executables, e.g. Windows... | 1,477 | Python | .py | 40 | 30.35 | 134 | 0.622734 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,040 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_inheritance_regress/models.py | import datetime
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
ordering = ('name',)
def __unicode__(self):
return u"%s the place" % self.name
class Restaurant(Place):
serves_hot... | 4,389 | Python | .py | 117 | 32.581197 | 76 | 0.722301 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,041 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_inheritance_regress/tests.py | """
Regression tests for Model inheritance behaviour.
"""
import datetime
from operator import attrgetter
from django.test import TestCase
from models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,
SelfRefChild, ArticleWithAutho... | 15,330 | Python | .py | 355 | 33.295775 | 80 | 0.620828 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,042 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/signals_regress/models.py | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=20)
authors = models.ManyToManyField(Author)
def __unicode__(self):
return self.nam... | 322 | Python | .py | 10 | 27.2 | 44 | 0.701299 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,043 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/signals_regress/tests.py | import sys
from StringIO import StringIO
from django.test import TestCase
from django.db import models
from regressiontests.signals_regress.models import Author, Book
signal_output = []
def pre_save_test(signal, sender, instance, **kwargs):
signal_output.append('pre_save signal, %s' % instance)
if kwargs.get... | 3,755 | Python | .py | 79 | 38.708861 | 83 | 0.649358 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,044 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/models.py | from django.db import models
class Article(models.Model):
headline = models.CharField(max_length=100, default='Default headline')
pub_date = models.DateTimeField()
def __unicode__(self):
return self.headline
class Meta:
ordering = ('-pub_date', 'headline')
| 300 | Python | .py | 8 | 31.125 | 75 | 0.690391 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,045 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/tests.py | """
A series of tests to establish that the command-line managment tools work as
advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE
and default settings.py files.
"""
import os
import shutil
import sys
import re
from django import conf, bin, get_version
from django.conf import settings
... | 61,095 | Python | .py | 1,084 | 48.049815 | 241 | 0.667252 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,046 | app_command.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/management/commands/app_command.py | from django.core.management.base import AppCommand
class Command(AppCommand):
help = 'Test Application-based commands'
requires_model_validation = False
args = '[appname ...]'
def handle_app(self, app, **options):
print 'EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items()))
... | 328 | Python | .py | 7 | 40.857143 | 86 | 0.703226 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,047 | noargs_command.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/management/commands/noargs_command.py | from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Test No-args commands"
requires_model_validation = False
def handle_noargs(self, **options):
print 'EXECUTE:NoArgsCommand options=%s' % sorted(options.items())
| 275 | Python | .py | 6 | 41 | 74 | 0.74812 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,048 | label_command.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/management/commands/label_command.py | from django.core.management.base import LabelCommand
class Command(LabelCommand):
help = "Test Label-based commands"
requires_model_validation = False
args = '<label>'
def handle_label(self, label, **options):
print 'EXECUTE:LabelCommand label=%s, options=%s' % (label, sorted(options.items()))... | 321 | Python | .py | 7 | 41.142857 | 92 | 0.717949 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,049 | base_command.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/management/commands/base_command.py | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--option_a','-a', action='store', dest='option_a', default='1'),
make_option('--option_b','-b', action='store', dest='option_b', de... | 658 | Python | .py | 13 | 45.153846 | 93 | 0.650078 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,050 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/app_with_import/models.py | from django.contrib.comments.models import Comment
from django.db import models
# Regression for #13368. This is an example of a model
# that imports a class that has an abstract base class.
class CommentScore(models.Model):
comment = models.OneToOneField(Comment, primary_key=True)
| 288 | Python | .py | 6 | 46.166667 | 61 | 0.807829 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,051 | bar.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/complex_app/models/bar.py | from django.db import models
from admin_scripts.complex_app.admin import foo
class Bar(models.Model):
name = models.CharField(max_length=5)
class Meta:
app_label = 'complex_app'
| 195 | Python | .py | 6 | 28.666667 | 47 | 0.739362 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,052 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/complex_app/models/__init__.py | from admin_scripts.complex_app.models.bar import Bar
from admin_scripts.complex_app.models.foo import Foo
__all__ = ['Foo', 'Bar']
| 132 | Python | .py | 3 | 42.666667 | 52 | 0.757813 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,053 | foo.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_scripts/complex_app/models/foo.py | from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=5)
class Meta:
app_label = 'complex_app'
| 147 | Python | .py | 5 | 25 | 41 | 0.702128 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,054 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/transactions_regress/tests.py | from django.core.exceptions import ImproperlyConfigured
from django.db import connection, transaction
from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError
from django.test import TransactionTestCase, skipUnlessDBFeature
from models import Mod
class TestTransactionClosing(T... | 6,586 | Python | .py | 145 | 35.489655 | 109 | 0.645282 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,055 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/max_lengths/models.py | from django.db import models
class PersonWithDefaultMaxLengths(models.Model):
email = models.EmailField()
vcard = models.FileField(upload_to='/tmp')
homepage = models.URLField()
avatar = models.FilePathField()
class PersonWithCustomMaxLengths(models.Model):
email = models.EmailField(max_length=250... | 482 | Python | .py | 11 | 39.727273 | 62 | 0.75693 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,056 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/max_lengths/tests.py | from django.db import DatabaseError
from django.utils import unittest
from regressiontests.max_lengths.models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
class MaxLengthArgumentsTests(unittest.TestCase):
def verify_max_length(self, model,field,length):
self.assertEqual(model._meta.get_f... | 1,620 | Python | .py | 29 | 47.482759 | 102 | 0.695268 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,057 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/one_to_one_regress/models.py | from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
def __unicode__(self):
return u"%s the place" % self.name
class Restaurant(models.Model):
place = models.OneToOneField(Place)
serves_hot_dogs = models.B... | 1,180 | Python | .py | 31 | 33.322581 | 58 | 0.718558 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,058 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/one_to_one_regress/tests.py | from django.test import TestCase
from regressiontests.one_to_one_regress.models import *
class OneToOneRegressionTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
self.r1 = Restaurant(place=self.p1, serves_hot_dogs=True, serves_... | 4,689 | Python | .py | 107 | 34.308411 | 85 | 0.631937 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,059 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/csrf_tests/tests.py | # -*- coding: utf-8 -*-
import warnings
from django.test import TestCase
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware
from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt, requires_csrf_token
from django.core.context_processor... | 16,310 | Python | .py | 343 | 39.676385 | 107 | 0.660089 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,060 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/null_fk/models.py | """
Regression tests for proper working of ForeignKey(null=True).
"""
from django.db import models
class SystemDetails(models.Model):
details = models.TextField()
class SystemInfo(models.Model):
system_details = models.ForeignKey(SystemDetails)
system_name = models.CharField(max_length=32)
class Forum(m... | 847 | Python | .py | 24 | 30.916667 | 61 | 0.727273 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,061 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/null_fk/tests.py | from django.test import TestCase
from regressiontests.null_fk.models import *
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First details')
s = SystemInfo.objects.create(system_name='First forum', system_details=d)
f = Forum.objects.create(... | 1,890 | Python | .py | 35 | 43.771429 | 105 | 0.625 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,062 | storage.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/staticfiles_tests/storage.py | from datetime import datetime
from django.core.files import storage
class DummyStorage(storage.Storage):
"""
A storage class that does implement modified_time() but raises
NotImplementedError when calling
"""
def _save(self, name, content):
return 'dummy'
def delete(self, name):
... | 447 | Python | .py | 15 | 24.2 | 66 | 0.682243 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,063 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/staticfiles_tests/tests.py | # -*- encoding: utf-8 -*-
import codecs
import os
import posixpath
import shutil
import sys
import tempfile
from StringIO import StringIO
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage impor... | 15,192 | Python | .py | 357 | 34.837535 | 98 | 0.668474 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,064 | default.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/staticfiles_tests/urls/default.py | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
)
| 159 | Python | .py | 4 | 37.5 | 76 | 0.720779 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,065 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/bug639/models.py | import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
from django.forms import ModelForm
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
class Photo(models.Model):
title = models.CharField(max_length=30)
image = models.Fi... | 821 | Python | .py | 20 | 36.35 | 75 | 0.718239 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,066 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/bug639/tests.py | """
Tests for file field behavior, and specifically #639, in which Model.save()
gets called *again* for each FileField. This test will fail if calling a
ModelForm's save() method causes Model.save() to be called more than once.
"""
import os
import shutil
from django.core.files.uploadedfile import SimpleUploadedFile
... | 1,346 | Python | .py | 33 | 34.424242 | 76 | 0.669479 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,067 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/managers_regress/models.py | """
Various edge-cases for model managers.
"""
from django.db import models
class OnlyFred(models.Manager):
def get_query_set(self):
return super(OnlyFred, self).get_query_set().filter(name='fred')
class OnlyBarney(models.Manager):
def get_query_set(self):
return super(OnlyBarney, self).get_q... | 2,430 | Python | .py | 71 | 29.492958 | 78 | 0.71073 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,068 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/managers_regress/tests.py | from django.test import TestCase
from models import Child1, Child2, Child3, Child4, Child5, Child6, Child7
class ManagersRegressionTests(TestCase):
def test_managers(self):
a1 = Child1.objects.create(name='fred', data='a1')
a2 = Child1.objects.create(name='barney', data='a2')
b1 = Child2.... | 2,544 | Python | .py | 47 | 43.957447 | 83 | 0.608434 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,069 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_registration/models.py | """
Tests for various ways of registering models with the admin site.
"""
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Location(models.Model):
class Meta:
abstract = True
class Place(Location):
name = models.CharField(max_length=200)
| 316 | Python | .py | 11 | 25.545455 | 65 | 0.747508 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,070 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_registration/tests.py | from django.test import TestCase
from django.core.exceptions import ImproperlyConfigured
from django.contrib import admin
from models import Person, Place, Location
class NameAdmin(admin.ModelAdmin):
list_display = ['name']
save_on_top = True
class TestRegistration(TestCase):
def setUp(self):
sel... | 2,296 | Python | .py | 51 | 35.823529 | 77 | 0.656823 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,071 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/servers/tests.py | """
Tests for django.core.servers.
"""
import os
import django
from django.test import TestCase
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler
from django.conf import settings
class AdminMediaHandlerTests(TestCase):
def setUp(self):
self.adm... | 2,557 | Python | .py | 62 | 30.064516 | 90 | 0.552251 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,072 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/bash_completion/tests.py | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import StringIO
from django.conf import settings
from django.core.management import ManagementUtility
from django.utils import unittest
class BashCompletionTests(unittest.TestCase):
"""
Testing the Python ... | 3,203 | Python | .py | 74 | 35.837838 | 128 | 0.66335 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,073 | test_command.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/bash_completion/management/commands/test_command.py | import sys, os
from optparse import OptionParser, make_option
from django.core.management.base import BaseCommand
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option("--list", action="store_true", dest="list",
help="Print all options"),
)
def han... | 362 | Python | .py | 10 | 30 | 63 | 0.672414 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,074 | edit.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/edit.py | from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase
from django.utils.unittest import expectedFailure
from regressiontests.generic_views.models import Artist, Author
from regressiontests.generic_views import view... | 13,869 | Python | .py | 244 | 46.709016 | 109 | 0.639267 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,075 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/models.py | from django.db import models
class Artist(models.Model):
name = models.CharField(max_length=100)
class Meta:
ordering = ['name']
verbose_name = 'professional artist'
verbose_name_plural = 'professional artists'
def __unicode__(self):
return self.name
@models.permalink... | 1,031 | Python | .py | 32 | 26.375 | 53 | 0.659919 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,076 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/urls.py | from django.conf.urls.defaults import *
from django.views.generic import TemplateView
from django.views.decorators.cache import cache_page
import views
urlpatterns = patterns('',
# base
#(r'^about/login-required/$',
# views.DecoratedAboutView()),
# TemplateView
(r'^template/no_template/$',
... | 9,307 | Python | .py | 190 | 42.221053 | 101 | 0.619037 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,077 | dates.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/dates.py | import datetime
import random
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from regressiontests.generic_views.models import Book
class ArchiveIndexViewTests(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'regressiontests.generic_views.urls'
def ... | 18,304 | Python | .py | 311 | 50.254019 | 107 | 0.661756 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,078 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/tests.py | from regressiontests.generic_views.base import ViewTest, TemplateViewTest, RedirectViewTest
from regressiontests.generic_views.dates import ArchiveIndexViewTests, YearArchiveViewTests, MonthArchiveViewTests, WeekArchiveViewTests, DayArchiveViewTests, DateDetailViewTests
from regressiontests.generic_views.detail import ... | 514 | Python | .py | 5 | 101.8 | 178 | 0.901768 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,079 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/base.py | import time
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.test import TestCase, RequestFactory
from django.utils import simplejson
from django.views.generic import View, TemplateView, RedirectView
class SimpleView(View):
"""
A simple ... | 8,991 | Python | .py | 206 | 35.669903 | 114 | 0.653873 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,080 | detail.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/detail.py | from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from regressiontests.generic_views.models import Artist, Author, Page
class DetailViewTest(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'regressiontests.generic_views.urls'
def test_simple_object(se... | 3,822 | Python | .py | 64 | 51.8125 | 94 | 0.697917 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,081 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/forms.py | from django import forms
from regressiontests.generic_views.models import Author
class AuthorForm(forms.ModelForm):
name = forms.CharField()
slug = forms.SlugField()
class Meta:
model = Author
| 217 | Python | .py | 7 | 26.571429 | 55 | 0.752427 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,082 | list.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/list.py | from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from regressiontests.generic_views.models import Author, Artist
from regressiontests.generic_views.views import CustomPaginator
class ListViewTests(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'regression... | 8,122 | Python | .py | 141 | 49.319149 | 90 | 0.679065 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,083 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/views.py | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views import generic
from regressiontests.generic_views.models import Artist, Author, Book, Page
from regre... | 4,506 | Python | .py | 117 | 33.222222 | 89 | 0.733534 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,084 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_inheritance/models.py | """
XX. Model inheritance
Model inheritance exists in two varieties:
- abstract base classes which are a way of specifying common
information inherited by the subclasses. They don't exist as a separate
model.
- non-abstract base classes (the default), which are models in their own
right with ... | 3,888 | Python | .py | 111 | 30.441441 | 89 | 0.702811 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,085 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_inheritance/tests.py | from operator import attrgetter
from django.core.exceptions import FieldError
from django.test import TestCase
from models import (Chef, CommonInfo, ItalianRestaurant, ParkingLot, Place,
Post, Restaurant, Student, StudentWorker, Supplier, Worker, MixinModel)
class ModelInheritanceTests(TestCase):
def test_a... | 10,540 | Python | .py | 243 | 32.958848 | 140 | 0.611106 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,086 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/user_commands/models.py | """
38. User-registered management commands
The ``manage.py`` utility provides a number of useful commands for managing a
Django project. If you want to add a utility command of your own, you can.
The user-defined command ``dance`` is defined in the management/commands
subdirectory of this test application. It is a s... | 600 | Python | .py | 11 | 53.272727 | 78 | 0.795222 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,087 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/user_commands/tests.py | from StringIO import StringIO
from django.test import TestCase
from django.core import management
from django.core.management.base import CommandError
class CommandTests(TestCase):
def test_command(self):
out = StringIO()
management.call_command('dance', stdout=out)
self.assertEqual(out.ge... | 706 | Python | .py | 17 | 34.941176 | 78 | 0.693878 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,088 | dance.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/user_commands/management/commands/dance.py | from optparse import make_option
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Dance around like a madman."
args = ''
requires_model_validation = True
option_list =[
make_option("-s", "--style", default="Rock'n'Roll")
]
def handle(self, *args,... | 411 | Python | .py | 11 | 32.454545 | 77 | 0.672544 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,089 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/files/models.py | """
42. Storing files according to a custom storage system
``FileField`` and its variations can take a ``storage`` argument to specify how
and where files should be stored.
"""
import random
import tempfile
from django.db import models
from django.core.files.base import ContentFile
from django.core.files.storage imp... | 1,206 | Python | .py | 25 | 44.64 | 100 | 0.760239 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,090 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/files/tests.py | import shutil
import sys
from django.core.cache import cache
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from models import Storage, temp_storage, temp_storage_location
if sys.version_info >= (2, 5):
from tests_25 im... | 4,113 | Python | .py | 87 | 38.804598 | 100 | 0.654691 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,091 | tests_25.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/files/tests_25.py | from __future__ import with_statement
import tempfile
from django.core.files import File
from django.utils.unittest import TestCase
class FileObjTests(TestCase):
def test_context_manager(self):
orig_file = tempfile.TemporaryFile()
base_file = File(orig_file)
with base_file as f:
... | 467 | Python | .py | 13 | 29.384615 | 44 | 0.7 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,092 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/one_to_one/models.py | """
10. One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from django.db import models, transaction, IntegrityError
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.Cha... | 1,408 | Python | .py | 34 | 36.970588 | 68 | 0.719324 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,093 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/one_to_one/tests.py | from django.test import TestCase
from django.db import transaction, IntegrityError
from models import Place, Restaurant, Waiter, ManualPrimaryKey, RelatedModel, MultiModel
class OneToOneTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
... | 5,714 | Python | .py | 109 | 43.165138 | 95 | 0.657909 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,094 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/test_client/models.py | # coding: utf-8
"""
39. Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of t... | 21,658 | Python | .py | 388 | 47.123711 | 148 | 0.674745 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,095 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/test_client/urls.py | from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
import views
urlpatterns = patterns('',
(r'^get_view/$', views.get_view),
(r'^post_view/$', views.post_view),
(r'^header_view/$', views.view_with_header),
(r'^raw_post_view/$', views.raw_post_view),
(r'^redi... | 1,592 | Python | .py | 28 | 52.535714 | 104 | 0.669866 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,096 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/test_client/tests.py | # Validate that you can override the default test suite
from django.utils import unittest
def suite():
"""
Define a suite that deliberately ignores a test defined in
this module.
"""
testSuite = unittest.TestSuite()
testSuite.addTest(SampleTests('testGoodStuff'))
return testSuite
... | 483 | Python | .py | 15 | 26.333333 | 62 | 0.724832 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,097 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/test_client/views.py | from xml.dom.minidom import parseString
from django.core import mail
from django.template import Context, Template
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.contrib.auth.decorators import login_required, permission_required
from django.forms.forms import Form
from dja... | 7,858 | Python | .py | 182 | 36.521978 | 128 | 0.662873 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,098 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/transactions/models.py | """
15. Transactions
Django handles transactions in three different ways. The default is to commit
each transaction upon a write, but you can decorate a function to get
commit-on-success behavior. Alternatively, you can manage the transaction
manually.
"""
from django.db import models, DEFAULT_DB_ALIAS
class Reporte... | 617 | Python | .py | 16 | 35.0625 | 77 | 0.735343 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,099 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/transactions/tests.py | import sys
from django.db import connection, transaction, IntegrityError, DEFAULT_DB_ALIAS
from django.conf import settings
from django.test import TransactionTestCase, skipUnlessDBFeature
from models import Reporter
if sys.version_info >= (2, 5):
from tests_25 import TransactionContextManagerTests
class Tran... | 6,706 | Python | .py | 159 | 33.465409 | 112 | 0.659868 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |