def test_non_homogeneous(self):
   x = self.x;
   y = self.y;
   z = self.z;
   f = x**4 + 4*y*z**3 - z**2;
   self.assertEqual(wieghted_max_degree(f,[2,1,2]),8);
 def test_negative_wieghts(self):
   x = self.x;
   y = self.y;
   z = self.z;
   f = x**4 + 4*y*z**3 - z**2;
   self.assertEqual(wieghted_max_degree(f,[-1,-1,1]),2);
 def test_zero(self):
   self.assertEqual(wieghted_max_degree(self.poly_ring.zero(),[1,1,1]),0);