'Make sure when something besides \'pk\' is used for detail_uri_name and
it isn\'t unique that we still look up the correct object and don\'t
create a duplicate.'

@skipIf((MyUUIDModel is None), u'UUIDField    not    available')
def test_put_detail_with_non_unique_uuid_detail_uri_name(self):

    self.assertFalse(MyUUIDModel._meta.get_field(u'anotheruuid').unique)
    myuuidmodel = MyUUIDModel.objects.create()
    self.assertEqual(MyUUIDModel.objects.count(), 1)
    request = MockRequest()
    request.GET = {u'format': u'json'}
    request.method = u'PUT'
    request.set_body(u'{"content":    "The    cat    is    back.    The    dog    coughed    him    up    out    back."}')
    resource = MyUUIDModelResourceNonUniqueDetailUriName()
    resp = resource.put_detail(request, anotheruuid=myuuidmodel.anotheruuid)
    self.assertEqual(resp.status_code, 200)
    self.assertEqual(MyUUIDModel.objects.count(), 1)
    data = json.loads(resp.content.decode(u'utf-8'))
    self.assertEqual(data[u'id'], str(myuuidmodel.pk))
    self.assertEqual(data[u'anotheruuid'], str(myuuidmodel.anotheruuid))
    self.assertNotEqual(data[u'content'], u'')
