Beispiel #1
0
from django.core.urlresolvers import reverse
from django.core.management import call_command
from django.test import TestCase
from django.test.client import Client
from random import random
from django_hello_world.hello.models import Requests, Contact, State
from django_hello_world.settings import rel
from django.conf import settings
from StringIO import StringIO
from django.template import RequestContext
from django.test.client import RequestFactory
from django_hello_world.hello.context_processors import django_settings, get_settings_dict
from django.contrib.contenttypes.models import ContentType

hello_fixtures_file = [rel(settings.FIXTURE_DIRS[0], 'full_dump.json')]


class HelloTest(TestCase):
    fixtures = hello_fixtures_file

    def setUp(self):
        self.c = Client()
        self.rnd = str(random())
        self.valid_form = {'name': self.rnd,
                           'surname': 'b',
                           'email': '*****@*****.**',
                           'jabber': '*****@*****.**',
                           'date_of_birth': '1985-02-17',
                           'skype': 'lksdl',
                           'photo': 'dlskf',
                           'other_contacts': 'd',
from StringIO import StringIO

from django.core.urlresolvers import reverse
from django.core.management import call_command
from django.test import TestCase
from django.conf import settings
from django.template import RequestContext, Template, Context
from django.test.client import RequestFactory
from django.contrib.contenttypes.models import ContentType

from django_hello_world.hello.models import Requests, Contact, State
from django_hello_world.settings import rel
from django_hello_world.hello.context_processors import django_settings, get_settings_dict
from django_hello_world.hello.middleware import HelloMiddlewares

hello_fixtures_file = [rel(settings.FIXTURE_DIRS[0], "test_data.json")]


class HelloViewsTest(TestCase):
    fixtures = hello_fixtures_file

    def setUp(self):
        self.somevalue = "blablabla"
        self.valid_form = {
            "name": self.somevalue,
            "surname": "b",
            "email": "*****@*****.**",
            "jabber": "*****@*****.**",
            "date_of_birth": "1985-02-17",
            "skype": "lksdl",
            "photo": "dlskf",
from StringIO import StringIO

from django.core.urlresolvers import reverse
from django.core.management import call_command
from django.test import TestCase
from django.conf import settings
from django.template import RequestContext, Template, Context
from django.test.client import RequestFactory
from django.contrib.contenttypes.models import ContentType

from django_hello_world.hello.models import Requests, Contact, State
from django_hello_world.settings import rel
from django_hello_world.hello.context_processors import django_settings, get_settings_dict
from django_hello_world.hello.middleware import HelloMiddlewares

hello_fixtures_file = [rel(settings.FIXTURE_DIRS[0], 'test_data.json')]


class HelloViewsTest(TestCase):
    fixtures = hello_fixtures_file

    def setUp(self):
        self.somevalue = 'blablabla'
        self.valid_form = {
            'name': self.somevalue,
            'surname': 'b',
            'email': '*****@*****.**',
            'jabber': '*****@*****.**',
            'date_of_birth': '1985-02-17',
            'skype': 'lksdl',
            'photo': 'dlskf',