def METHOD_NAME(self):
    """Test filtering results by code."""
    today = date.today()
    # Create 3 wikimetrics for active_contributors:
    for i in range(3):
        WikiMetricFactory(code=METRIC_CODE_CHOICES[0][0], date=today - timedelta(days=i))
    # Create 1 for percent_localized_all:
    WikiMetricFactory(code=METRIC_CODE_CHOICES[1][0])
    # Call and verify the API for code=METRIC_CODE_CHOICES[0].
    response = self.client.get(
        urlparams(
            reverse("api.wikimetric_list"), format="json", code=METRIC_CODE_CHOICES[0][0]
        )
    )
    self.assertEqual(200, response.status_code)
    results = json.loads(response.content)["results"]
    self.assertEqual(3, len(results))
    # Call and verify the API for code=METRIC_CODE_CHOICES[1].
    response = self.client.get(
        urlparams(
            reverse("api.wikimetric_list"), format="json", code=METRIC_CODE_CHOICES[1][0]
        )
    )
    self.assertEqual(200, response.status_code)
    results = json.loads(response.content)["results"]
    self.assertEqual(1, len(results))