예제 #1
0
파일: tests.py 프로젝트: amezhenin/talon
 def test_unicode(self):
     """
     Testing string representation of TOdo object
     """
     user = UserFactory()
     user.save()
     todo = TodoFactory(user=user, text=u'my task')
     todo.save()
     self.assertEqual(unicode(todo), u'my task')
예제 #2
0
파일: tests.py 프로젝트: amezhenin/talon
    def test_user(self):
        """
        Create user with factory
        """
        self.assertEqual(User.objects.count(), 0)

        user = UserFactory()
        user.save()

        self.assertEqual(User.objects.count(), 1)
예제 #3
0
파일: tests.py 프로젝트: amezhenin/talon
    def test_todo(self):
        """
        Create todo with factory
        """
        self.assertEqual(Todo.objects.count(), 0)

        user = UserFactory()
        user.save()
        todo = TodoFactory(user=user)
        todo.save()

        self.assertEqual(Todo.objects.count(), 1)