This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CyclePostTest(TestCase): | |
def setUp(self): | |
user = User.objects.create_user('murilo', 'murilo@murilo.com', 'murilo') | |
farm = Farm.objects.create(user=user, name='teste', full_area='123.45', uncultivated_area='0.00') | |
self.client.login(username='murilo', password='murilo') | |
data = dict(farm=farm, user=user, name='2014') | |
self.resp = self.client.post('/ciclo/cadastrar/', data) | |
def test_post(self): | |
'Valid Post should redirect to /ciclo/1/.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
from django.test import TestCase | |
from django.contrib.auth.models import User | |
from django.test.client import Client | |
from django.template.defaultfilters import slugify | |
from django.test.client import RequestFactory | |
from fazenda.core.models import Fazenda | |
from fazenda.core.views import FazendaDetail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% load breadcrumbs %} | |
{% block breadcrumbs %} | |
{% breadcrumb 'Upload' %} | |
{% endblock %} | |
{% block css_especifico %} | |
<link rel="stylesheet" href="{{ STATIC_URL }}assets/css/dropzone.css"> | |
{% endblock %} | |
{% block title %}Upload{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base64 import b32encode | |
from hashlib import sha1 | |
from random import random | |
def pkgen(): | |
rude = ('lol',) | |
bad_pk = True | |
while bad_pk: | |
pk = b32encode(sha1(str(random())).digest()).lower()[:32] | |
bad_pk = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from south.modelsinspector import add_introspection_rules | |
from django.db import models | |
from django.db.models import permalink | |
from django.contrib.auth.models import User | |
from core.models import Cliente | |
from biblioteca.models import Imagem | |
from base64 import b32encode | |
from hashlib import sha1 | |
from random import random |
NewerOlder