class TestLocation(TestCase):
    def setUp(self):
        self.l = Location(name="the name",
                          description="the short description")

    def testHasAName(self):
        self.assertEqual(self.l.name, 'the name')

    def testNameIsUnique(self):
        self.l.save()
        with self.assertRaises(IntegrityError):
            Location.objects.create(name='the name')

    def testHasADescription(self):
        self.assertEqual(self.l.description, 'the short description')
Пример #2
0
class TestLocation(TestCase):
    def setUp(self):
        self.l = Location(
            name="the name",
            web_summary_description="the web summary description",
            assignment_message_description="assignment message description")

    def testHasAName(self):
        self.assertEqual(self.l.name, 'the name')

    def testNameIsUnique(self):
        self.l.save()
        with self.assertRaises(IntegrityError):
            Location.objects.create(name='the name')

    def testHasAWebSummaryDescription(self):
        self.assertEqual(self.l.web_summary_description,
                         'the web summary description')

    def testHasAnAssignmentMessageDescription(self):
        self.assertEqual(self.l.assignment_message_description,
                         'assignment message description')
 def setUp(self):
     self.l = Location(name="the name",
                       description="the short description")
Пример #4
0
 def setUp(self):
     self.l = Location(
         name="the name",
         web_summary_description="the web summary description",
         assignment_message_description="assignment message description")