def test_create_self_user_library_entry(self):
        results = model_access.create_self_user_library_entry('bigbrother', 1)
        self.assertIsNotNone(results)

        results = model_access.create_self_user_library_entry('bigbrother', 1, position=3)
        self.assertIsNotNone(results)

        model_access.create_self_user_library_entry('bigbrother', 33)
        results = model_access.get_self_application_library('bigbrother')
        self.assertEquals(results.reverse()[0].listing.id, 33)
Example #2
0
    def test_create_self_user_library_entry(self):
        results = model_access.create_self_user_library_entry('bigbrother', 1)
        self.assertIsNotNone(results)

        results = model_access.create_self_user_library_entry('bigbrother', 1, position=3)
        self.assertIsNotNone(results)

        model_access.create_self_user_library_entry('bigbrother', 33)
        results = model_access.get_self_application_library('bigbrother')
        self.assertEquals(results.reverse()[0].listing.id, 33)
Example #3
0
 def create(self, validated_data):
     username = self.context['request'].user.username
     listing_id = validated_data['listing']['id']
     folder_name = validated_data.get('folder')
     position = validated_data.get('position')
     return model_access.create_self_user_library_entry(
         username, listing_id, folder_name, position)
 def create(self, validated_data):
     username = self.context['request'].user.username
     listing_id = validated_data['listing']['id']
     folder_name = validated_data.get('folder')
     position = validated_data.get('position')
     return model_access.create_self_user_library_entry(username, listing_id, folder_name, position)
Example #5
0
 def test_create_self_user_library_entry_exception(self):
     with self.assertRaisesRegex(Exception,
                                 'Listing or user not found') as err:
         results = model_access.create_self_user_library_entry(
             'not_exist_user', 3)
 def test_create_self_user_library_entry_exception(self):
     with self.assertRaisesRegex(Exception, 'Listing or user not found') as err:
         results = model_access.create_self_user_library_entry('not_exist_user', 3)