Example #1
0
def first_provider():
    if ProviderModel.get_by_cnpj("04790618000153") != None:
        return
    new_provider = ProviderModel()
    new_provider.name = "Fornecedor 01"
    new_provider.cnpj = "04790618000153"
    new_provider.address = "Endereço 01"
    new_provider.city = "Cidade 01"
    new_provider.country = "País 01"
    new_provider.cep_code = "000000-000"
    new_provider.responsible_name = "Matheus D'Adamo Milani"
    new_provider.responsible_email = "*****@*****.**"
    new_provider.responsible_phone = "+55(11)97717-9999"
    new_provider.active = True
    new_provider.save()
    return
Example #2
0
    def test_save_provider(self):
        providers = len(ProviderModel.list())

        new_provider = ProviderModel()
        new_provider.name = "Fornecedor 02"
        new_provider.cnpj = "98617744000154"
        new_provider.address = "Endereço 02"
        new_provider.city = "Cidade 02"
        new_provider.country = "País 02"
        new_provider.cep_code = "000000-000"
        new_provider.responsible_name = "Matheus D'Adamo Milani 01"
        new_provider.responsible_email = "*****@*****.**"
        new_provider.responsible_phone = "+55(11)97717-8888"
        new_provider.active = True
        new_provider.save()

        assert providers + 1 == len(ProviderModel.list())