| 244 | sess.get_one(WeatherLocation, 25) |
| 245 | |
| 246 | def test_get_explicit_shard(self): |
| 247 | sess = self._fixture_data() |
| 248 | tokyo = ( |
| 249 | sess.query(WeatherLocation) |
| 250 | .set_shard("europe") |
| 251 | .where(WeatherLocation.id == 1) |
| 252 | .first() |
| 253 | ) |
| 254 | is_(tokyo, None) |
| 255 | |
| 256 | newyork = ( |
| 257 | sess.query(WeatherLocation) |
| 258 | .set_shard("north_america") |
| 259 | .where(WeatherLocation.id == 2) |
| 260 | .first() |
| 261 | ) |
| 262 | eq_(newyork.city, "New York") |
| 263 | |
| 264 | # now it found it |
| 265 | t2 = sess.get(WeatherLocation, 1) |
| 266 | eq_(t2.city, "Tokyo") |
| 267 | |
| 268 | @testing.variation("option_type", ["none", "lazyload", "selectinload"]) |
| 269 | @testing.variation( |