Ejemplo n.º 1
0
    def test_unicode(self):
        """Test unicode conversion."""
        with open(
                os.path.join(settings.BASE_DIR,
                             'auvsi_suas/fixtures/testdata/S.jpg')) as f:
            thumb = SimpleUploadedFile('thumb.jpg', f.read())

        l = GpsPosition(latitude=38, longitude=-76)
        l.save()

        t = Odlc(user=self.user,
                 odlc_type=OdlcType.standard,
                 location=l,
                 orientation=Orientation.s,
                 shape=Shape.square,
                 background_color=Color.white,
                 alphanumeric='ABC',
                 alphanumeric_color=Color.black,
                 description='Test odlc',
                 thumbnail=thumb)
        t.save()

        self.assertTrue(t.__unicode__())
Ejemplo n.º 2
0
    def test_minimal_unicode(self):
        """Unicode with only user and odlc."""
        t = Odlc(user=self.user, odlc_type=OdlcType.standard)
        t.save()

        self.assertTrue(t.__unicode__())