      def test_foreign_key_update_with_invalid_null(self):
          data = {'url': 'http://testserver/foreignkeysource/1/', 'name': 'source-1', 'target': None}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data, context={'request': request})
          self.assertFalse(serializer.is_valid())
          self.assertEqual(serializer.errors, {'target': ['This field may not be null.']})
  
  
  @override_settings(ROOT_URLCONF='tests.test_relations_hyperlink')
  class HyperlinkedNullableForeignKeyTests(TestCase):
      def setUp(self):
 
</s> remove         self.assertFalse(serializer.is_valid())
        self.assertEqual(serializer.errors, {'target': ['Incorrect type. Expected URL string, received int.']})
 </s> add         assert not serializer.is_valid()
        assert serializer.errors == {'target': ['Incorrect type. Expected URL string, received int.']} </s> remove         self.assertEqual(serializer.data, expected)
 </s> add         assert serializer.data == expected </s> remove         self.assertEqual(serializer.data, expected)
 </s> add         assert serializer.data == expected </s> remove             self.assertEqual(serializer.data, expected)
 </s> add             assert serializer.data == expected </s> remove         self.assertTrue(serializer.is_valid())
 </s> add         assert serializer.is_valid()
        assert not serializer.is_valid()
        assert serializer.errors == {'target': ['This field may not be null.']}
      def test_foreign_key_update_with_invalid_null(self):
          data = {'url': 'http://testserver/foreignkeysource/1/', 'name': 'source-1', 'target': None}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data, context={'request': request})
        assert not serializer.is_valid()
        assert serializer.errors == {'target': ['This field may not be null.']}
        assert not serializer.is_valid()
        assert serializer.errors == {'target': ['This field may not be null.']}
  
  
  @override_settings(ROOT_URLCONF='tests.test_relations_hyperlink')
  class HyperlinkedNullableForeignKeyTests(TestCase):
      def setUp(self):
keep keep keep keep replace replace keep keep keep keep keep
 converted test asserts of hyperlin relations to pytest 
tests/test_relations_hyperlink.py