コード例 #1
0
ファイル: tests_equipment.py プロジェクト: sergafts/servermon
    def test_get_allocation_nonexistent(self):

        equipment = Equipment.objects.get(serial='R123457')
        serializer = EquipmentSerializer()
        self.assertEqual(None, serializer.get_allocation(equipment))
コード例 #2
0
ファイル: tests_equipment.py プロジェクト: sergafts/servermon
    def test_get_allocation_none(self):

        serializer = EquipmentSerializer()
        self.assertEqual(None, serializer.get_allocation(None))
コード例 #3
0
ファイル: tests_equipment.py プロジェクト: sergafts/servermon
    def test_get_allocation_existent(self):

        equipment = Equipment.objects.get(serial='G123456')
        allocation = equipment.allocation
        serializer = EquipmentSerializer()
        self.assertEqual(allocation, serializer.get_allocation(equipment))