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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,900 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_permalink/models.py | from django.db import models
class Guitarist(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
@models.permalink
def url(self):
"Returns the URL for this guitarist."
return ('guitarist_detail', [self.slug])
| 284 | Python | .py | 8 | 30.25 | 48 | 0.70073 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,901 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_permalink/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^guitarists/(\w{1,50})/$', 'unimplemented_view_placeholder', name='guitarist_detail'),
)
| 167 | Python | .py | 4 | 39.5 | 96 | 0.716049 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,902 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_permalink/tests.py | from django.test import TestCase
from regressiontests.model_permalink.models import Guitarist
class PermalinkTests(TestCase):
urls = 'regressiontests.model_permalink.urls'
def test_permalink(self):
g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
self.assertEqual(g.url(), '/guitari... | 602 | Python | .py | 11 | 48.727273 | 78 | 0.734694 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,903 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/dates/models.py | from django.db import models
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateField()
categories = models.ManyToManyField("Category", related_name="articles")
def __unicode__(self):
return self.title
class Comment(models.Model):
article = model... | 656 | Python | .py | 16 | 36.0625 | 76 | 0.709321 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,904 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/dates/tests.py | from datetime import datetime
from django.test import TestCase
from models import Article, Comment, Category
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=datetime(2005, 7, 28),
)
a2 = A... | 2,391 | Python | .py | 74 | 20.891892 | 71 | 0.494805 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,905 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
1,906 | localflavortests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavortests.py | from localflavor.ar import ARLocalFlavorTests
from localflavor.at import ATLocalFlavorTests
from localflavor.au import AULocalFlavorTests
from localflavor.be import BELocalFlavorTests
from localflavor.br import BRLocalFlavorTests
from localflavor.ca import CALocalFlavorTests
from localflavor.ch import CHLocalFlavorTest... | 1,484 | Python | .py | 32 | 45.34375 | 55 | 0.911096 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,907 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/models.py | # -*- coding: utf-8 -*-
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import Form, ModelForm, FileField, ModelChoiceField
from django.test import TestCase
from regressiontests.forms.models import ChoiceModel, ChoiceOptionModel, ChoiceFieldModel, FileModel, Group, Bounda... | 9,010 | Python | .py | 138 | 58.123188 | 217 | 0.684655 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,908 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/util.py | # -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.forms.util import *
from django.utils.translation import ugettext_lazy
from django.utils.unittest import TestCase
class FormsUtilTestCase(TestCase):
# Tests for forms/util.py module.
def test_flatatt(self):
###... | 2,630 | Python | .py | 44 | 48.522727 | 148 | 0.583042 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,909 | input_formats.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/input_formats.py | from datetime import time, date, datetime
from django import forms
from django.conf import settings
from django.utils.translation import activate, deactivate
from django.utils.unittest import TestCase
class LocalizedTimeTests(TestCase):
def setUp(self):
self.old_TIME_INPUT_FORMATS = settings.TIME_INPUT_F... | 38,975 | Python | .py | 687 | 47.873362 | 107 | 0.660172 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,910 | error_messages.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/error_messages.py | # -*- coding: utf-8 -*-
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.test import TestCase
from django.utils.safestring import mark_safe
from django.utils import unittest
class AssertFormErrorsMixin(object):
def assertFormErrors(self, expected, the_callable, *... | 10,684 | Python | .py | 224 | 37.941964 | 119 | 0.590356 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,911 | regressions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/regressions.py | # -*- coding: utf-8 -*-
from django.forms import *
from django.utils.unittest import TestCase
from django.utils.translation import ugettext_lazy, activate, deactivate
from regressiontests.forms.models import Cheese
class FormsRegressionsTestCase(TestCase):
def test_class(self):
# Tests to prevent against... | 7,623 | Python | .py | 108 | 61.268519 | 634 | 0.626522 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,912 | formsets.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/formsets.py | # -*- coding: utf-8 -*-
from django.forms import Form, CharField, IntegerField, ValidationError, DateField
from django.forms.formsets import formset_factory, BaseFormSet
from django.utils.unittest import TestCase
class Choice(Form):
choice = CharField()
votes = IntegerField()
# FormSet allows us to use mult... | 41,032 | Python | .py | 731 | 46.819425 | 231 | 0.610852 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,913 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/__init__.py | from error_messages import *
from extra import *
from fields import FieldsTests
from forms import *
from formsets import *
from input_formats import *
from media import *
from models import *
from regressions import *
from util import *
from validators import TestFieldWithValidators
from widgets import *
from regressi... | 1,050 | Python | .py | 25 | 39.2 | 68 | 0.852539 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,914 | validators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/validators.py | from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.unittest import TestCase
class TestFieldWithValidators(TestCase):
def test_all_errors_get_reported(self):
field = forms.CharField(
validators=[validators.validate_in... | 581 | Python | .py | 14 | 34.642857 | 79 | 0.720354 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,915 | media.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/media.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.utils.unittest import TestCase
class FormsMediaTestCase(TestCase):
# Tests for the media handling on widgets and forms
def setUp(self):
super(FormsMed... | 46,165 | Python | .py | 793 | 48.619168 | 173 | 0.582186 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,916 | widgets.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/widgets.py | # -*- coding: utf-8 -*-
import datetime
from decimal import Decimal
import re
import time
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.forms.widgets import RadioFieldRenderer
from django.utils import copycompat as copy
from django.... | 67,270 | Python | .py | 991 | 61.279516 | 671 | 0.628594 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,917 | fields.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/fields.py | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... | 59,519 | Python | .py | 863 | 59.849363 | 207 | 0.640139 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,918 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/forms.py | # -*- coding: utf-8 -*-
import datetime
from decimal import Decimal
import re
import time
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.http import QueryDict
from django.template import Template, Context
from django.utils.datastructures import MultiValueDict, Merge... | 104,530 | Python | .py | 1,503 | 61.7831 | 516 | 0.633796 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,919 | extra.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/tests/extra.py | # -*- coding: utf-8 -*-
import datetime
import time
from django.conf import settings
from django.forms import *
from django.forms.extras import SelectDateWidget
from django.forms.util import ErrorList
from django.utils import translation
from django.utils import unittest
from django.utils.encoding import force_unicode
... | 24,191 | Python | .py | 575 | 38.022609 | 171 | 0.659662 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,920 | uk.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/uk.py | from django.contrib.localflavor.uk.forms import UKPostcodeField
from utils import LocalFlavorTestCase
class UKLocalFlavorTests(LocalFlavorTestCase):
def test_UKPostcodeField(self):
error_invalid = [u'Enter a valid postcode.']
valid = {
'BT32 4PX': 'BT32 4PX',
'GIR 0AA': 'G... | 1,023 | Python | .py | 27 | 28.037037 | 84 | 0.561934 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,921 | cz.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/cz.py | import warnings
from django.contrib.localflavor.cz.forms import (CZPostalCodeField,
CZRegionSelect, CZBirthNumberField, CZICNumberField)
from django.core.exceptions import ValidationError
from utils import LocalFlavorTestCase
class CZLocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
self.save_... | 3,842 | Python | .py | 95 | 31.926316 | 89 | 0.626706 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,922 | de.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/de.py | from django.contrib.localflavor.de.forms import (DEZipCodeField, DEStateSelect,
DEIdentityCardNumberField)
from utils import LocalFlavorTestCase
class DELocalFlavorTests(LocalFlavorTestCase):
def test_DEStateSelect(self):
f = DEStateSelect()
out = u'''<select name="states">
<option value="BW"... | 1,847 | Python | .py | 44 | 36.409091 | 110 | 0.697442 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,923 | ie.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ie.py | from django.contrib.localflavor.ie.forms import IECountySelect
from utils import LocalFlavorTestCase
class IELocalFlavorTests(LocalFlavorTestCase):
def test_IECountySelect(self):
f = IECountySelect()
out = u'''<select name="counties">
<option value="antrim">Antrim</option>
<option value="armagh">... | 1,629 | Python | .py | 40 | 38.95 | 62 | 0.762926 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,924 | fr.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/fr.py | from django.contrib.localflavor.fr.forms import (FRZipCodeField,
FRPhoneNumberField, FRDepartmentSelect)
from utils import LocalFlavorTestCase
class FRLocalFlavorTests(LocalFlavorTestCase):
def test_FRZipCodeField(self):
error_format = [u'Enter a zip code in the format XXXXX.']
valid = {
... | 5,951 | Python | .py | 140 | 39.528571 | 75 | 0.676714 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,925 | tr.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/tr.py | # Tests for the contrib/localflavor/ TR form fields.
from django.contrib.localflavor.tr import forms as trforms
from django.core.exceptions import ValidationError
from django.utils.unittest import TestCase
class TRLocalFlavorTests(TestCase):
def test_TRPostalCodeField(self):
f = trforms.TRPostalCodeField(... | 3,456 | Python | .py | 69 | 40.043478 | 68 | 0.654153 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,926 | es.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/es.py | from django.contrib.localflavor.es.forms import (ESPostalCodeField, ESPhoneNumberField,
ESIdentityCardNumberField, ESCCCField, ESRegionSelect, ESProvinceSelect)
from utils import LocalFlavorTestCase
class ESLocalFlavorTests(LocalFlavorTestCase):
def test_ESRegionSelect(self):
f = ESRegionSelect()
... | 6,531 | Python | .py | 162 | 33.895062 | 112 | 0.652242 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,927 | kw.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/kw.py | from django.contrib.localflavor.kw.forms import KWCivilIDNumberField
from utils import LocalFlavorTestCase
class KWLocalFlavorTests(LocalFlavorTestCase):
def test_KWCivilIDNumberField(self):
error_invalid = [u'Enter a valid Kuwaiti Civil ID number']
valid = {
'282040701483': '28204070... | 480 | Python | .py | 12 | 32.333333 | 68 | 0.700431 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,928 | br.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/br.py | from django.contrib.localflavor.br.forms import (BRZipCodeField,
BRCNPJField, BRCPFField, BRPhoneNumberField, BRStateSelect,
BRStateChoiceField)
from utils import LocalFlavorTestCase
class BRLocalFlavorTests(LocalFlavorTestCase):
def test_BRZipCodeField(self):
error_format = [u'Enter a zip code i... | 5,144 | Python | .py | 136 | 29.058824 | 107 | 0.5658 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,929 | ar.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ar.py | from django.contrib.localflavor.ar.forms import (ARProvinceSelect,
ARPostalCodeField, ARDNIField, ARCUITField)
from utils import LocalFlavorTestCase
class ARLocalFlavorTests(LocalFlavorTestCase):
def test_ARProvinceSelect(self):
f = ARProvinceSelect()
out = u'''<select name="provincias">
<opt... | 3,743 | Python | .py | 93 | 32.268817 | 87 | 0.611416 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,930 | jp.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/jp.py | from django.contrib.localflavor.jp.forms import (JPPostalCodeField,
JPPrefectureSelect)
from utils import LocalFlavorTestCase
class JPLocalFlavorTests(LocalFlavorTestCase):
def test_JPPrefectureSelect(self):
f = JPPrefectureSelect()
out = u'''<select name="prefecture">
<option value="hokkaido... | 2,762 | Python | .py | 69 | 36.362319 | 82 | 0.72183 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,931 | nl.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/nl.py | from django.contrib.localflavor.nl.forms import (NLPhoneNumberField,
NLZipCodeField, NLSoFiNumberField, NLProvinceSelect)
from utils import LocalFlavorTestCase
class NLLocalFlavorTests(LocalFlavorTestCase):
def test_NLProvinceSelect(self):
f = NLProvinceSelect()
out = u'''<select name="provin... | 2,084 | Python | .py | 56 | 29.392857 | 68 | 0.620673 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,932 | sk.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/sk.py | from django.contrib.localflavor.sk.forms import (SKRegionSelect,
SKPostalCodeField, SKDistrictSelect)
from utils import LocalFlavorTestCase
class SKLocalFlavorTests(LocalFlavorTestCase):
def test_SKRegionSelect(self):
f = SKRegionSelect()
out = u'''<select name="regions">
<option value="BB">B... | 4,333 | Python | .py | 111 | 36.657658 | 78 | 0.727294 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,933 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/utils.py | from django.core.exceptions import ValidationError
from django.core.validators import EMPTY_VALUES
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils.unittest import TestCase
class LocalFlavorTestCase(TestCase):
# NOTE: These are copied from the TestCase Django uses for tes... | 2,190 | Python | .py | 45 | 38.466667 | 80 | 0.662459 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,934 | za.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/za.py | from django.contrib.localflavor.za.forms import ZAIDField, ZAPostCodeField
from utils import LocalFlavorTestCase
class ZALocalFlavorTests(LocalFlavorTestCase):
def test_ZAIDField(self):
error_invalid = [u'Enter a valid South African ID number']
valid = {
'0002290001003': '000229000100... | 922 | Python | .py | 25 | 27.72 | 74 | 0.617021 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,935 | generic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/generic.py | import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from utils import LocalFlavorTestCase
class GenericLocalFlavorTests(LocalFlavorTestCase):
def test_GenericDateField(self):
error_invalid = [u'Enter a valid date.']
valid = {
datetime.date(20... | 4,326 | Python | .py | 81 | 42.493827 | 111 | 0.573148 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,936 | is_.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/is_.py | from django.contrib.localflavor.is_.forms import (ISIdNumberField,
ISPhoneNumberField, ISPostalCodeSelect)
from utils import LocalFlavorTestCase
class ISLocalFlavorTests(LocalFlavorTestCase):
def test_ISPostalCodeSelect(self):
f = ISPostalCodeSelect()
out = u'''<select name="foo">
<option val... | 9,043 | Python | .py | 192 | 44 | 102 | 0.725193 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,937 | us.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/us.py | from django.contrib.localflavor.us.forms import (USZipCodeField,
USPhoneNumberField, USStateField, USStateSelect, USSocialSecurityNumberField)
from utils import LocalFlavorTestCase
class USLocalFlavorTests(LocalFlavorTestCase):
def test_USStateSelect(self):
f = USStateSelect()
out = u'''<sele... | 4,615 | Python | .py | 121 | 32.61157 | 93 | 0.656041 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,938 | se.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/se.py | # -*- coding: utf-8 -*-
from django.contrib.localflavor.se.forms import (SECountySelect,
SEOrganisationNumberField, SEPersonalIdentityNumberField,
SEPostalCodeField)
import datetime
from utils import LocalFlavorTestCase
class SELocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
# Mocking da... | 6,442 | Python | .py | 153 | 32.385621 | 81 | 0.614343 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,939 | au.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/au.py | from django.contrib.localflavor.au.forms import (AUPostCodeField,
AUPhoneNumberField, AUStateSelect)
from utils import LocalFlavorTestCase
class AULocalFlavorTests(LocalFlavorTestCase):
def test_AUStateSelect(self):
f = AUStateSelect()
out = u'''<select name="state">
<option value="ACT">A... | 1,685 | Python | .py | 44 | 30.431818 | 66 | 0.623242 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,940 | ch.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ch.py | from django.contrib.localflavor.ch.forms import (CHZipCodeField,
CHPhoneNumberField, CHIdentityCardNumberField, CHStateSelect)
from utils import LocalFlavorTestCase
class CHLocalFlavorTests(LocalFlavorTestCase):
def test_CHStateSelect(self):
f = CHStateSelect()
out = u'''<select name="state">... | 2,604 | Python | .py | 68 | 32.132353 | 116 | 0.661104 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,941 | be.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/be.py | from django.contrib.localflavor.be.forms import (BEPostalCodeField,
BEPhoneNumberField, BERegionSelect, BEProvinceSelect)
from utils import LocalFlavorTestCase
class BELocalFlavorTests(LocalFlavorTestCase):
def test_BEPostalCodeField(self):
error_format = [u'Enter a valid postal code in the range and... | 2,977 | Python | .py | 73 | 32.246575 | 90 | 0.594548 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,942 | it.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/it.py | from django.contrib.localflavor.it.forms import (ITZipCodeField, ITRegionSelect,
ITSocialSecurityNumberField, ITVatNumberField)
from utils import LocalFlavorTestCase
class ITLocalFlavorTests(LocalFlavorTestCase):
def test_ITRegionSelect(self):
f = ITRegionSelect()
out = u'''<select name="regi... | 2,466 | Python | .py | 63 | 32.444444 | 80 | 0.667923 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,943 | uy.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/uy.py | from django.contrib.localflavor.uy.forms import UYDepartamentSelect, UYCIField
from django.contrib.localflavor.uy.util import get_validation_digit
from utils import LocalFlavorTestCase
class UYLocalFlavorTests(LocalFlavorTestCase):
def test_UYDepartmentSelect(self):
f = UYDepartamentSelect()
out ... | 2,000 | Python | .py | 47 | 36.851064 | 96 | 0.665123 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,944 | ca.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ca.py | import warnings
from django.contrib.localflavor.ca.forms import (CAPostalCodeField,
CAPhoneNumberField, CAProvinceField, CAProvinceSelect,
CASocialInsuranceNumberField)
from utils import LocalFlavorTestCase
class CALocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
self.save_warning... | 3,636 | Python | .py | 97 | 28.556701 | 97 | 0.589286 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,945 | cl.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/cl.py | from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect
from django.core.exceptions import ValidationError
from utils import LocalFlavorTestCase
class CLLocalFlavorTests(LocalFlavorTestCase):
def test_CLRegionSelect(self):
f = CLRegionSelect()
out = u'''<select name="foo">
<opt... | 2,290 | Python | .py | 52 | 37.019231 | 91 | 0.643081 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,946 | il.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/il.py | from django.contrib.localflavor.il.forms import (ILPostalCodeField,
ILIDNumberField)
from utils import LocalFlavorTestCase
class ILLocalFlavorTests(LocalFlavorTestCase):
def test_ILPostalCodeField(self):
error_format = [u'Enter a postal code in the format XXXXX']
valid = {
'69973'... | 1,227 | Python | .py | 35 | 25.028571 | 67 | 0.564815 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,947 | fi.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/fi.py | from django.contrib.localflavor.fi.forms import (FIZipCodeField,
FISocialSecurityNumber, FIMunicipalitySelect)
from utils import LocalFlavorTestCase
class FILocalFlavorTests(LocalFlavorTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipalitySelect()
out = u'''<select name="municipal... | 16,281 | Python | .py | 376 | 41.571809 | 74 | 0.766652 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,948 | pl.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/pl.py | from django.contrib.localflavor.pl.forms import (PLProvinceSelect,
PLCountySelect, PLPostalCodeField, PLNIPField, PLPESELField, PLREGONField)
from utils import LocalFlavorTestCase
class PLLocalFlavorTests(LocalFlavorTestCase):
def test_PLProvinceSelect(self):
f = PLProvinceSelect()
out = u'''... | 21,811 | Python | .py | 453 | 46.015453 | 104 | 0.776642 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,949 | pt.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/pt.py | from django.contrib.localflavor.pt.forms import PTZipCodeField, PTPhoneNumberField
from utils import LocalFlavorTestCase
class PTLocalFlavorTests(LocalFlavorTestCase):
def test_PTZipCodeField(self):
error_format = [u'Enter a zip code in the format XXXX-XXX.']
valid = {
'3030-034': '30... | 1,063 | Python | .py | 28 | 28.392857 | 82 | 0.588749 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,950 | id.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/id.py | import warnings
from django.contrib.localflavor.id.forms import (IDPhoneNumberField,
IDPostCodeField, IDNationalIdentityNumberField, IDLicensePlateField,
IDProvinceSelect, IDLicensePlatePrefixSelect)
from utils import LocalFlavorTestCase
class IDLocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
... | 7,253 | Python | .py | 183 | 33.983607 | 77 | 0.665958 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,951 | at.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/at.py | from django.contrib.localflavor.at.forms import (ATZipCodeField, ATStateSelect,
ATSocialSecurityNumberField)
from utils import LocalFlavorTestCase
class ATLocalFlavorTests(LocalFlavorTestCase):
def test_ATStateSelect(self):
f = ATStateSelect()
out = u'''<select name="bundesland">
<option valu... | 1,525 | Python | .py | 40 | 31.2 | 96 | 0.652027 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,952 | ro.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ro.py | # -*- coding: utf-8 -*-
from django.contrib.localflavor.ro.forms import (ROCIFField, ROCNPField,
ROCountyField, ROCountySelect, ROIBANField, ROPhoneNumberField,
ROPostalCodeField)
from utils import LocalFlavorTestCase
class ROLocalFlavorTests(LocalFlavorTestCase):
def test_ROCountySelect(self):
f... | 5,203 | Python | .py | 130 | 33.238462 | 87 | 0.644537 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,953 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/handlers/tests.py | from django.utils import unittest
from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
class HandlerTests(unittest.TestCase):
def test_lock_safety(self):
"""
Tests for bug #11193 (errors inside middleware shouldn't leave
the initLock locked).
"""
... | 850 | Python | .py | 22 | 30.772727 | 70 | 0.678788 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,954 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/file_storage/tests.py | # -*- coding: utf-8 -*-
import os
import shutil
import sys
import tempfile
import time
from datetime import datetime, timedelta
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
import threading
except ImportError:
import dummy_threading as threading
from djang... | 16,422 | Python | .py | 372 | 35.696237 | 99 | 0.651177 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,955 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/custom_columns_regress/models.py | """
Regression for #9736.
Checks some pathological column naming to make sure it doesn't break
table creation or queries.
"""
from django.db import models
class Article(models.Model):
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
headline = models.CharField(max_length=100)
auth... | 1,029 | Python | .py | 24 | 37.875 | 99 | 0.696878 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,956 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/custom_columns_regress/tests.py | from django.test import TestCase
from django.core.exceptions import FieldError
from models import Author, Article
def pks(objects):
""" Return pks to be able to compare lists"""
return [o.pk for o in objects]
class CustomColumnRegression(TestCase):
def assertRaisesMessage(self, exc, msg, func, *args, **... | 2,919 | Python | .py | 71 | 31.704225 | 129 | 0.610229 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,957 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/null_queries/models.py | from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
def __unicode__(self):
return u"Q: %s " % self.question
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
def __unicode__(self):
r... | 668 | Python | .py | 18 | 32.833333 | 66 | 0.709176 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,958 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/null_queries/tests.py | from django.test import TestCase
from django.core.exceptions import FieldError
from regressiontests.null_queries.models import *
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.
None is interpreted as an SQL NULL, b... | 2,893 | Python | .py | 67 | 33.253731 | 87 | 0.614509 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,959 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_forms_regress/models.py | import os
from django.db import models
from django.core.exceptions import ValidationError
class Person(models.Model):
name = models.CharField(max_length=100)
class Triple(models.Model):
left = models.IntegerField()
middle = models.IntegerField()
right = models.IntegerField()
class Meta:
... | 2,200 | Python | .py | 52 | 37.403846 | 92 | 0.720526 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,960 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/model_forms_regress/tests.py | from datetime import date
from django import forms
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.models import (modelform_factory, ModelChoiceField,
fields_for_model, construct_instance)
from django.utils import unitte... | 18,937 | Python | .py | 373 | 41.823056 | 165 | 0.650771 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,961 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/delete_regress/models.py | from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
class Award(models.Model):
name = models.CharField(max_length=25)
object_id = models.PositiveIntegerField()
content_type = models.ForeignKey(ContentType)
content_obje... | 1,583 | Python | .py | 39 | 36.871795 | 80 | 0.766667 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,962 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/delete_regress/tests.py | import datetime
from django.conf import settings
from django.db import backend, connection, transaction, DEFAULT_DB_ALIAS
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from models import (Book, Award, AwardNote, Person, Child, Toy, PlayedWith,
PlayedWithNote, Contact, Email, Researche... | 5,217 | Python | .py | 114 | 36.438596 | 102 | 0.651438 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,963 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/middleware_exceptions/urls.py | # coding: utf-8
from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
(r'^view/$', views.normal_view),
(r'^not_found/$', views.not_found),
(r'^error/$', views.server_error),
(r'^null_view/$', views.null_view),
(r'^permission_denied/$', views.permission_denied),
(r'^t... | 437 | Python | .py | 12 | 32.833333 | 67 | 0.668246 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,964 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/middleware_exceptions/tests.py | import sys
from django.conf import settings
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.template import Template
from django.test import TestCase
class TestException(Exception):
pass
# A middleware ba... | 39,506 | Python | .py | 658 | 51.392097 | 121 | 0.708217 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,965 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/middleware_exceptions/views.py | from django import http
from django.core.exceptions import PermissionDenied
from django.template import Template
from django.template.response import TemplateResponse
def normal_view(request):
return http.HttpResponse('OK')
def template_response(request):
return TemplateResponse(request, Template('OK'))
def... | 626 | Python | .py | 18 | 31.777778 | 53 | 0.796667 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,966 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_validation/models.py | """
Tests of ModelAdmin validation logic.
"""
from django.db import models
class Album(models.Model):
title = models.CharField(max_length=150)
class Song(models.Model):
title = models.CharField(max_length=150)
album = models.ForeignKey(Album)
original_release = models.DateField(editable=False)
... | 1,245 | Python | .py | 35 | 30.914286 | 68 | 0.727731 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,967 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_validation/tests.py | from django.contrib import admin
from django import forms
from django.contrib.admin.validation import validate, validate_inline, \
ImproperlyConfigured
from django.test import TestCase
from models import Song, Book, Album, TwoAlbumFKAndAnE, State, City
class SongForm(forms.... | 9,015 | Python | .py | 205 | 33.565854 | 167 | 0.629651 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,968 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/string_lookup/models.py | # -*- coding: utf-8 -*-
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def __unicode__(self):
return "Foo %s" % self.name
class Bar(models.Model):
name = models.CharField(max_length=50)
norm... | 1,199 | Python | .py | 33 | 31.212121 | 65 | 0.664645 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,969 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/string_lookup/tests.py | # -*- coding: utf-8 -*-
from django.test import TestCase
from regressiontests.string_lookup.models import Foo, Whiz, Bar, Article, Base, Child
class StringLookupTests(TestCase):
def test_string_form_referencing(self):
"""
Regression test for #1661 and #1662
Check that string form referenc... | 2,384 | Python | .py | 56 | 33.964286 | 108 | 0.624892 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,970 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/aggregation_regress/models.py | # coding: utf-8
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __unicode__(self):
return self.name
class Publisher(models.Model):
name = models.CharFiel... | 1,778 | Python | .py | 46 | 33.5 | 86 | 0.703444 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,971 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/aggregation_regress/tests.py | import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
from django.test import TestCase, Approximate, skipUnlessDBFeature
from models import Author, Book, Publishe... | 32,986 | Python | .py | 726 | 34.422865 | 227 | 0.579019 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,972 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/multiple_database/models.py | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
class Review(models.Model):
source = models.CharField(max_length=100)
content_type = models.Foreig... | 2,243 | Python | .py | 59 | 32.864407 | 72 | 0.707891 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,973 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/multiple_database/tests.py | import datetime
import pickle
import sys
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth.models import User
from django.core import management
from django.db import connections, router, DEFAULT_DB_ALIAS
from django.db.models import signals
from django.db.utils import ConnectionR... | 85,975 | Python | .py | 1,499 | 45.887925 | 139 | 0.633552 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,974 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/expressions_regress/models.py | """
Model for testing arithmetic expressions.
"""
from django.db import models
class Number(models.Model):
integer = models.IntegerField(db_column='the_integer')
float = models.FloatField(null=True, db_column='the_float')
def __unicode__(self):
return u'%i, %.3f' % (self.integer, self.float)
clas... | 637 | Python | .py | 19 | 28.842105 | 63 | 0.687908 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,975 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/expressions_regress/tests.py | """
Spanning tests for all the operations that F() expressions can perform.
"""
import datetime
from django.conf import settings
from django.db import models, connection
from django.db.models import F
from django.test import TestCase, Approximate, skipUnlessDBFeature
from regressiontests.expressions_regress.models im... | 16,681 | Python | .py | 330 | 39.230303 | 109 | 0.614199 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,976 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/test_runner/tests.py | """
Tests for django test runner
"""
import StringIO
from django.core.exceptions import ImproperlyConfigured
from django.test import simple
from django.utils import unittest
class DjangoTestRunnerTests(unittest.TestCase):
def test_failfast(self):
class MockTestOne(unittest.TestCase):
def runT... | 4,102 | Python | .py | 98 | 32.469388 | 106 | 0.585886 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,977 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/serializers_regress/models.py | """
A test spanning all the capabilities of all the serializers.
This class sets up a model for each model field type
(except for image types, because of the PIL dependency).
"""
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
fro... | 7,687 | Python | .py | 182 | 38.807692 | 84 | 0.768682 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,978 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/serializers_regress/tests.py | """
A test spanning all the capabilities of all the serializers.
This class defines sample data and a dynamically generated
test case that is capable of testing the capabilities of
the serializers. This includes all valid data values, plus
forward, backwards and self references.
"""
import datetime
import decimal
tr... | 15,965 | Python | .py | 357 | 40.154062 | 100 | 0.676722 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,979 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/defer_regress/models.py | """
Regression tests for defer() / only() behavior.
"""
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import connection, models
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = mod... | 1,003 | Python | .py | 28 | 31.821429 | 76 | 0.73423 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,980 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/defer_regress/tests.py | from operator import attrgetter
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db import connection
from django.db.models.loading import cache
from django.test import TestCase
from models import Resol... | 5,528 | Python | .py | 130 | 31.776923 | 122 | 0.590512 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,981 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/conditional_processing/models.py | # -*- coding:utf-8 -*-
from datetime import datetime
from django.test import TestCase
from django.utils import unittest
from django.utils.http import parse_etags, quote_etag, parse_http_date
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 21... | 6,873 | Python | .py | 127 | 46.047244 | 88 | 0.674059 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,982 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/conditional_processing/urls.py | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
('^$', views.index),
('^last_modified/$', views.last_modified_view1),
('^last_modified2/$', views.last_modified_view2),
('^etag/$', views.etag_view1),
('^etag2/$', views.etag_view2),
)
| 286 | Python | .py | 9 | 28.444444 | 53 | 0.644928 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,983 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/conditional_processing/views.py | # -*- coding:utf-8 -*-
from django.views.decorators.http import condition, etag, last_modified
from django.http import HttpResponse
from models import FULL_RESPONSE, LAST_MODIFIED, ETAG
def index(request):
return HttpResponse(FULL_RESPONSE)
index = condition(lambda r: ETAG, lambda r: LAST_MODIFIED)(index)
def la... | 878 | Python | .py | 19 | 43.789474 | 96 | 0.79108 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,984 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/queryset_pickle/models.py | import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
def standalone_number(self):
return 1
class Numbers(object):
@staticmethod
def get_static_number(self):
return 2
@classmethod
def get_class_number(self):
return 3
def get_memb... | 1,014 | Python | .py | 26 | 34.615385 | 80 | 0.747959 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,985 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/queryset_pickle/tests.py | import pickle
import datetime
from django.test import TestCase
from models import Group, Event, Happening
class PickleabilityTestCase(TestCase):
def assert_pickles(self, qs):
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
def test_related_field(self):
g = Group.objects.cre... | 1,210 | Python | .py | 24 | 44.083333 | 83 | 0.741056 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,986 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_changelist/models.py | from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(models.Model):
parent = models.ForeignKey(Parent, editable=False, null=True)
name = models.CharField(max_length=30, blank=True)
class Genre(models.Model):
name = models.CharField(max_length=20... | 1,353 | Python | .py | 36 | 33.333333 | 74 | 0.748466 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,987 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_changelist/tests.py | from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.views.main import ChangeList
from django.core.paginator import Paginator
from django.template import Context, Template
from django.test import TransactionTestCase
from models import (Child, Par... | 13,499 | Python | .py | 249 | 44.907631 | 272 | 0.646872 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,988 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/decorators/tests.py | from sys import version_info
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.contrib.admin.views.decorators import staff_member_req... | 6,377 | Python | .py | 146 | 37.041096 | 96 | 0.689922 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,989 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/settings_tests/tests.py | from django.conf import settings
from django.utils import unittest
from django.conf import settings, UserSettingsHolder, global_settings
class SettingsTests(unittest.TestCase):
#
# Regression tests for #10130: deleting settings.
#
def test_settings_delete(self):
settings.TEST = 'test'
... | 2,686 | Python | .py | 60 | 35.4 | 110 | 0.643788 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,990 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/introspection/models.py | from django.db import models
class Reporter(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField()
facebook_user_id = models.BigIntegerField()
def __unicode__(self):
return u"%s %s" % (self.first_name, self.last_n... | 586 | Python | .py | 16 | 31.375 | 59 | 0.689046 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,991 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/introspection/tests.py | from django.conf import settings
from django.db import connection, DEFAULT_DB_ALIAS
from django.test import TestCase, skipUnlessDBFeature
from django.utils import functional
from models import Reporter, Article
#
# The introspection module is optional, so methods tested here might raise
# NotImplementedError. This is... | 4,699 | Python | .py | 94 | 42.244681 | 99 | 0.676112 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,992 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_inline_admin/models.py | from django.db import models
from django.contrib import admin
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
class Episode(models.Model):
name = models.CharField(max_length=100)
class Media(models.Model):
"""
Media that can associated to any obje... | 2,687 | Python | .py | 84 | 28.690476 | 75 | 0.773893 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,993 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_inline_admin/urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
)
| 147 | Python | .py | 5 | 27.4 | 43 | 0.744681 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,994 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/generic_inline_admin/tests.py | # coding: utf-8
from django.conf import settings
from django.contrib.contenttypes.generic import generic_inlineformset_factory
from django.test import TestCase
# local test models
from models import Episode, EpisodeExtra, EpisodeMaxNum, EpisodeExclude, \
Media, EpisodePermanent, MediaPermanentInlin... | 13,477 | Python | .py | 184 | 64.380435 | 527 | 0.685393 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,995 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_util/models.py | from django.db import models
class Article(models.Model):
"""
A simple Article model for testing
"""
site = models.ForeignKey('sites.Site', related_name="admin_articles")
title = models.CharField(max_length=100)
title2 = models.CharField(max_length=100, verbose_name="another name")
created ... | 1,081 | Python | .py | 28 | 33.571429 | 75 | 0.715517 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,996 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/admin_util/tests.py | from datetime import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.util import display_for_field, label_for_field, lookup_field
from django.contrib.admin.util import NestedObjects
from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
from django.contr... | 7,534 | Python | .py | 200 | 28.045 | 105 | 0.59545 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,997 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/localflavor/tests.py | from django.test import TestCase
from django.utils import unittest
# just import your tests here
from us.tests import *
| 121 | Python | .py | 4 | 29 | 33 | 0.836207 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,998 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/localflavor/us/models.py | from django.db import models
from django.contrib.localflavor.us.models import USStateField
from django.contrib.localflavor.us.models import USPostalCodeField
# When creating models you need to remember to add a app_label as
# 'localflavor', so your model can be found
class USPlace(models.Model):
state = USStateFi... | 567 | Python | .py | 13 | 40 | 66 | 0.769928 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
1,999 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/regressiontests/localflavor/us/tests.py | from django.test import TestCase
from forms import USPlaceForm
class USLocalflavorTests(TestCase):
def setUp(self):
self.form = USPlaceForm({'state':'GA', 'state_req':'NC', 'postal_code': 'GA', 'name':'impossible'})
def test_get_display_methods(self):
"""Test that the get_*_display() methods a... | 6,153 | Python | .py | 150 | 39.053333 | 107 | 0.728076 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |