コード例 #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_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)