Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Created November 9, 2011 13:38
Show Gist options
  • Save gilsondev/1351450 to your computer and use it in GitHub Desktop.
Save gilsondev/1351450 to your computer and use it in GitHub Desktop.
Exemplo de como testar se determinado registro foi excluído no banco de dados no Django.
# -*- coding: utf8 -*-
from django.test import TestCase
# (...)
def test_excluir_usuario(self):
"""O Usuario e excluido?"""
id_usuario = 12 # Teste desse exemplo
self.assertRaises(User.DoesNotExist, User.objects.get,
pk=id_usuario)
@gilsondev
Copy link
Author

Está certo. Obrigado pela correção =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment