Esempio n. 1
0
 def test_delete_user(self):
     """Method to test deleting user map."""
     user_map = UserMapFactory.create()
     self.assertIsNotNone(user_map.pk)
     user_map.delete()
     message = 'The user map is not deleted.'
     self.assertIsNone(user_map.pk, message)
Esempio n. 2
0
    def test_read_usermap(self):
        """Method to test reading user map."""
        user = UserFactory(username='******')
        location = Point(5, 5)
        image = '/john/doe/image.png'

        usermap = UserMapFactory.create(user=user,
                                        location=location,
                                        image=image)

        message = 'The username should be %s, but it gives %s' % (
            user.username, usermap.user.username)
        self.assertEqual(user.username, usermap.user.username, message)

        message = 'The user location should be %s, but it gives %s' % (
            location, usermap.location)
        self.assertEqual(location, usermap.location, message)

        message = 'The user image should be %s, but it gives %s' % (
            image, usermap.image)
        self.assertEqual(image, usermap.image, message)
Esempio n. 3
0
 def test_create_usermap(self):
     """Method to test user map creation."""
     user_map = UserMapFactory.create()
     message = 'The user map is not instantiated successfully.'
     self.assertIsNotNone(user_map.user, message)