mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-10-31 07:57:31 +03:00 
			
		
		
		
	Fix asserts for errors that come back with visualised location
This commit is contained in:
		
							parent
							
								
									51fe6d06a9
								
							
						
					
					
						commit
						b63fd1cd7c
					
				|  | @ -52,7 +52,9 @@ def get_choices(choices): | ||||||
|             while name in converted_names: |             while name in converted_names: | ||||||
|                 name += "_" + str(len(converted_names)) |                 name += "_" + str(len(converted_names)) | ||||||
|             converted_names.append(name) |             converted_names.append(name) | ||||||
|             description = str(help_text)  # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58 |             description = str( | ||||||
|  |                 help_text | ||||||
|  |             )  # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58 | ||||||
|             yield name, value, description |             yield name, value, description | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -612,9 +612,9 @@ def test_should_enforce_first_or_last(graphene_settings): | ||||||
| 
 | 
 | ||||||
|     result = schema.execute(query) |     result = schema.execute(query) | ||||||
|     assert len(result.errors) == 1 |     assert len(result.errors) == 1 | ||||||
|     assert str(result.errors[0]) == ( |     assert str(result.errors[0]).startswith( | ||||||
|         "You must provide a `first` or `last` value to properly " |         "You must provide a `first` or `last` value to properly " | ||||||
|         "paginate the `allReporters` connection." |         "paginate the `allReporters` connection.\n" | ||||||
|     ) |     ) | ||||||
|     assert result.data == expected |     assert result.data == expected | ||||||
| 
 | 
 | ||||||
|  | @ -653,9 +653,9 @@ def test_should_error_if_first_is_greater_than_max(graphene_settings): | ||||||
| 
 | 
 | ||||||
|     result = schema.execute(query) |     result = schema.execute(query) | ||||||
|     assert len(result.errors) == 1 |     assert len(result.errors) == 1 | ||||||
|     assert str(result.errors[0]) == ( |     assert str(result.errors[0]).startswith( | ||||||
|         "Requesting 101 records on the `allReporters` connection " |         "Requesting 101 records on the `allReporters` connection " | ||||||
|         "exceeds the `first` limit of 100 records." |         "exceeds the `first` limit of 100 records.\n" | ||||||
|     ) |     ) | ||||||
|     assert result.data == expected |     assert result.data == expected | ||||||
| 
 | 
 | ||||||
|  | @ -694,9 +694,9 @@ def test_should_error_if_last_is_greater_than_max(graphene_settings): | ||||||
| 
 | 
 | ||||||
|     result = schema.execute(query) |     result = schema.execute(query) | ||||||
|     assert len(result.errors) == 1 |     assert len(result.errors) == 1 | ||||||
|     assert str(result.errors[0]) == ( |     assert str(result.errors[0]).startswith( | ||||||
|         "Requesting 101 records on the `allReporters` connection " |         "Requesting 101 records on the `allReporters` connection " | ||||||
|         "exceeds the `last` limit of 100 records." |         "exceeds the `last` limit of 100 records.\n" | ||||||
|     ) |     ) | ||||||
|     assert result.data == expected |     assert result.data == expected | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user