# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1286306186 -3600
# Node ID 263d2c897fb91f477662b5dfb1ef93a5ddd7738d
# Parent  bc10678f636e82f2c78203db82abccb6d6f3babf
#11076: bug in is_divisible_by

diff -r bc10678f636e -r 263d2c897fb9 sage/schemes/elliptic_curves/ell_point.py
--- a/sage/schemes/elliptic_curves/ell_point.py	Wed Sep 29 21:04:23 2010 -0700
+++ b/sage/schemes/elliptic_curves/ell_point.py	Tue Oct 05 20:16:26 2010 +0100
@@ -790,9 +790,27 @@
             False
             sage: Q.is_divisible_by(5)
             True
+
+        TESTS:
+
+        This shows that the bug reported at #10076 is fixed::
+
+            sage: K = QuadraticField(8,'a')
+            sage: E = EllipticCurve([K(0),0,0,-1,0])
+            sage: P = E([-1,0])
+            sage: P.is_divisible_by(2)
+            False
+            sage: P.division_points(2)
+            []
+
+        Note that it is not sufficient to test that
+        ``self.division_points(m,poly_only=True)`` has roots::
+
+            sage: P.division_points(2, poly_only=True).roots()
+            [(1/2*a - 1, 1), (-1/2*a - 1, 1)]
+
         """
-        g = self.division_points(m, poly_only=True)
-        return len(g.roots(multiplicities=False)) > 0
+        return len(self.division_points(m)) > 0
 
     def division_points(self, m, poly_only=False):
         r"""
