def test_assumptions():
 (m, n) = symbols('m n', integer=True, positive=True)
 diof = diophantine((((n ** 2) + (m * n)) - 500))
 assert (diof == set([(5, 20), (40, 10), (95, 5), (121, 4), (248, 2), (499, 1)]))
 (a, b) = symbols('a b', integer=True, positive=False)
 diof = diophantine(((((a * b) + (2 * a)) + (3 * b)) - 6))
 assert (diof == set([((-15), (-3)), ((-9), (-4)), ((-7), (-5)), ((-6), (-6)), ((-5), (-8)), ((-4), (-14))]))

def test_assumptions ( ) : ( m , n ) = symbols ( 'm n' , integer = True , positive = True ) diof = diophantine ( ( ( ( n ** 2 ) + ( m * n ) ) - 500 ) ) assert ( diof == set ( [ ( 5 , 20 ) , ( 40 , 10 ) , ( 95 , 5 ) , ( 121 , 4 ) , ( 248 , 2 ) , ( 499 , 1 ) ] ) ) ( a , b ) = symbols ( 'a b' , integer = True , positive = False ) diof = diophantine ( ( ( ( ( a * b ) + ( 2 * a ) ) + ( 3 * b ) ) - 6 ) ) assert ( diof == set ( [ ( ( - 15 ) , ( - 3 ) ) , ( ( - 9 ) , ( - 4 ) ) , ( ( - 7 ) , ( - 5 ) ) , ( ( - 6 ) , ( - 6 ) ) , ( ( - 5 ) , ( - 8 ) ) , ( ( - 4 ) , ( - 14 ) ) ] ) )
test whether diophantine respects the assumptions .