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
@pytest.mark.django_db | |
def test_deve_fazer_novo_pedido_de_entrega(marca1, grafica, user_delivery_marca1): | |
# Dado um cadastro e seu estoque disponível | |
vinil = marca1 | |
vinil_itaim = Unidade.objects.filter(marca=vinil).first() | |
sacolas = Categoria.objects.create(categoria="Sacolas") | |
sacola = Produto.objects.create( | |
nome="Sacola Delivery", categoria=sacolas, marca=vinil, fornecedor=grafica | |
) |
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
import pytest | |
from embalae.accounts.models import User, Fornecedor, Marca, Unidade | |
@pytest.fixture | |
def marca1(db): | |
marca_um = Marca.objects.create(nome="Marca 1", slug="Marca1") | |
Unidade.objects.create(nome="Marca 1-U1", marca=marca_um) | |
return marca_um |
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 django.db import models | |
from django.urls import reverse | |
from django.contrib.auth import get_user_model | |
class Categoria(models.Model): | |
nome = models.CharField(max_length=32) | |
class Produto(models.Model): |
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
resource "random_integer" "postgres_port" { | |
min = 5432 | |
max = 5432 | |
} | |
resource "google_sql_database_instance" "postgres" { | |
name = "${var.environment}-postgres" | |
database_version = var.engine_version | |
deletion_protection = var.deletion_protection |
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
""" | |
14 <-- \o/ | |
7 | |
T | |
""" |
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
<template> | |
<h1>Listar Pokemon</h1> | |
<ul> | |
<li v-for="pokemon of listaPokemon" :key="pokemon.id"> | |
<p> | |
{{ pokemon.name }} | |
<span><button @click="obterDetalhes(pokemon)">detalhes</button></span> | |
</p> | |
<div v-if="pokemon.detalhe"> | |
<p>{{ pokemon.detalhe.base_experience }} <img :src="pokemon.detalhe.image" alt="" /></p> |
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
def cep_json_xml(cep, formato): | |
cepEntrada = cep | |
tipoCep ="" | |
cepTemp ="" | |
metodo ="buscarCep" | |
formato = formato.lower() | |
url = 'http://m.correios.com.br/movel/buscaCepConfirma.do' | |
post_data_dictionary = {'cepEntrada': cepEntrada, 'tipoCep': tipoCep, 'cepTemp': cepTemp, 'metodo':metodo} |
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
""" | |
Celery Tasks | |
============ | |
This file defines the expected API. | |
""" | |
import jsonschema | |
from celery import Celery, subtask, group, chord | |
from . import settings |
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
<template> | |
<div> | |
<!-- componente que encapsula o PUSH NOTIFICATION --> | |
<push-notification | |
ref="pushNotification" | |
:currentToken="userToken" | |
@update-token="onUpdateToken" | |
@new-message="onNewMessage" /> |
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
#!/bin/bash | |
# This script is based on | |
# https://medium.com/welcome-to-the-django/guia-definitivo-para-organizar-meu-ambiente-python-a16e2479b753 | |
PYTHON2_VERSION='2.7.12' | |
PYTHON3_VERSION='3.5.2' | |
sudo apt-get install -y git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev | |
sudo pip install virtualenvwrapper |
NewerOlder